This repository was archived by the owner on Apr 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ function findPackages {
1919 done
2020}
2121
22+ # findChangedFiles determines the files changed via git commits and the local working copy.
23+ # Note: findChangedFiles included deleted files (the license check script does not).
2224function findChangedFiles {
23- CHANGED_FILES=($( git diff --name-only --diff-filter=ACMRTUXB HEAD | tr ' \n' ' ' ) )
24- declare REMOTE_REF=$( git log -1 --pretty=format:" %d" | grep ' [(].*\/' | wc -l)
25+ declare diffFilter=" ACMRTUXBD"
2526
26- # TODO: handle untracked files
27+ CHANGED_FILES=($( git diff --name-only --diff-filter=${diffFilter} HEAD | tr ' \n' ' ' ) )
28+ declare REMOTE_REF=$( git log -1 --pretty=format:" %d" | grep ' [(].*\/' | wc -l)
2729
2830 # If CHANGED_FILES is empty then there is no working directory changes: fallback to last two commits.
2931 # Else if REMOTE_REF=0 then working copy commits are even with remote: only use the working copy changes.
@@ -36,7 +38,7 @@ function findChangedFiles {
3638 fi
3739
3840 declare -a LAST_COMMITS=($( git log -2 --pretty=format:" %h" ) )
39- CHANGED_FILES+=($( git diff-tree --no-commit-id --name-only --diff-filter=ACMRTUXB -r ${LAST_COMMITS[1]} ${LAST_COMMITS[0]} | tr ' \n' ' ' ) )
41+ CHANGED_FILES+=($( git diff-tree --no-commit-id --name-only --diff-filter=${diffFilter} -r ${LAST_COMMITS[1]} ${LAST_COMMITS[0]} | tr ' \n' ' ' ) )
4042 else
4143 echo " Examining working directory changes"
4244 fi
You can’t perform that action at this time.
0 commit comments