Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit c61ab2b

Browse files
committed
[FAB-11064] Account for deleted files in tests
Change-Id: Ie3ab341b6502aff6ad5f35dbcc11532d5bb95534 Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent 22a0f77 commit c61ab2b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/scripts/lib/find_packages.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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).
2224
function 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

0 commit comments

Comments
 (0)