Skip to content

Commit 1eed2e9

Browse files
facaiyseanpmorgan
authored andcommitted
BLD: get changed files from common ancestor (#71)
1 parent dfd34c8 commit 1eed2e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/ci_build/builds/builds_common.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ num_cpus() {
4242
echo ${N_CPUS}
4343
}
4444

45-
# List files changed (i.e., added, or revised).
45+
# List files changed (i.e., added, or revised) from
46+
# the common ancestor of HEAD and the latest master branch.
4647
# Usage: get_changed_files_from_master_branch
4748
get_changed_files_from_master_branch() {
48-
git diff origin/master --diff-filter=d --name-only "$@"
49+
ANCESTOR=$(git merge-base HEAD master origin/master)
50+
git diff ${ANCESTOR} --diff-filter=d --name-only "$@"
4951
}
5052

5153
# List bazel files changed that still exist,

0 commit comments

Comments
 (0)