Skip to content

Commit d28ce00

Browse files
committed
Travis: Use shallow fetches
We only compare files in current PR with the base branch. There's no need to fetch the full git history or branches that are not involved in the comparison. This is to save time in Travis runs.
1 parent 2ea0386 commit d28ce00

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.travis.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ matrix:
6868
before_script:
6969
- mkdir -p SCANCODE
7070
- mkdir -p SCANCODE_NEW_FILES
71-
# Fetch remaining information needed for branch comparison
72-
- git fetch --all --unshallow --tags
73-
- git fetch origin "${TRAVIS_BRANCH}"
71+
# Fetch the base branch to compare against
72+
- git fetch origin "${TRAVIS_BRANCH}" --depth=1
7473
script:
7574
# scancode does not support list of files, only one file or directory
7675
# we use SCANCODE directory for all changed files (their copies with full tree)
@@ -130,9 +129,8 @@ matrix:
130129
export PATH="${PWD}/bin:${PATH}";
131130
cd -
132131
- astyle --version
133-
# Fetch remaining information needed for branch comparison
134-
- git fetch --all --unshallow --tags
135-
- git fetch origin "${TRAVIS_BRANCH}"
132+
# Fetch the base branch to compare against
133+
- git fetch origin "${TRAVIS_BRANCH}" --depth=1
136134
script:
137135
- >-
138136
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
@@ -246,9 +244,8 @@ matrix:
246244
- python -m pip install --upgrade setuptools==40.4.3
247245
- pip install tabulate argparse
248246
- pip list --verbose
249-
# Fetch remaining information needed for branch comparison
250-
- git fetch --all --unshallow --tags
251-
- git fetch origin "${TRAVIS_BRANCH}"
247+
# Fetch the base branch to compare against
248+
- git fetch origin "${TRAVIS_BRANCH}" --depth=1
252249
script:
253250
- >-
254251
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \

0 commit comments

Comments
 (0)