Skip to content

Commit 4fc4d17

Browse files
Merge pull request #66075 from aireilly/update-travis-git-diff
Fixing git diff in Travis check
2 parents cc9b21d + 5a45e98 commit 4fc4d17

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/get-updated-distros.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
# Returns a list of updated _topic_map.yml files.
44
# The list includes any topic maps that are themselves modified, and indirectly modifed topic maps where incldued AsciiDoc files have been updated.
55

6+
# Handle the git diff differently for Travis and local
67
# Get the *.adoc and distro maps files in the pull request
7-
FILES=$(git diff --name-only HEAD HEAD~$(git rev-list --count --no-merges origin/main..) --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*')
8+
if [ "$TRAVIS" = true ] ; then
9+
FILES=$(git diff --name-only HEAD $TRAVIS_BRANCH --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*')
10+
11+
else
12+
FILES=$(git diff --name-only HEAD@{1} --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*')
13+
fi
14+
815
REPO_PATH=$(git rev-parse --show-toplevel)
16+
917
# Init an empty array
1018
DISTROS=()
1119

@@ -39,7 +47,7 @@ for ASSEMBLY in $ALL_ASSEMBLIES; do
3947
fi
4048
done
4149

42-
# Handle modified topic maps
50+
# Handle modified topic maps
4351
UPDATED_DISTROS=$(echo "$FILES" | awk '/_topic_maps\/(.*)\.yml/')
4452
# Concat all the updated topic maps
4553
DISTROS+=("${UPDATED_DISTROS}")

0 commit comments

Comments
 (0)