Original "HEAD~$NO_COMMITS" returns a diff agains current repo state
including not stashed changes. As the purpose of uncrustify is to
check commits, let's get changes against HEAD itself and ignore
local modifications.
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
.github/workflows/uncrustify-check.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/uncrustify-check.sh b/.github/workflows/uncrustify-check.sh
index ff61a6ae0f61..c94b892634b8 100755
--- a/.github/workflows/uncrustify-check.sh
+++ b/.github/workflows/uncrustify-check.sh
@@ -31,7 +31,7 @@ fi
cd "$REPO_PATH"
FAILURE=0
-CHANGED_FILES=$(git diff --name-only HEAD~$NO_COMMITS | grep '\(\.c$\|\.h$\)')
+CHANGED_FILES=$(git diff --name-only HEAD~$NO_COMMITS..HEAD | grep '\(\.c$\|\.h$\)')
if [ -z "$CHANGED_FILES" ]
then
echo "No c or h file to run uncrustify check"
--
2.32.0 (Apple Git-132)
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109231): https://edk2.groups.io/g/devel/message/109231
Mute This Topic: https://groups.io/mt/101667894/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-