Skip to content

Commit 13e3755

Browse files
authored
Merge pull request #6 from martin-g/shallow-git-ops-for-test
Shallow git clone/fetch in runTests.sh
2 parents 3ecee4c + ea0626c commit 13e3755

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/runTests.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ if [ ! -z "$su2branch" ]; then
6666
echo "Branch provided. Cloning to $PWD/src/$name"
6767
cd "src"
6868

69+
if [ -d $name ]; then
70+
# Remove any previous local repo. For non-ephemeral self-hosted runners
71+
rm -rf $name
72+
fi
6973
# Clone su2code/SU2, su2code/TestCases and su2code/Tutorials
70-
git clone -b master https://github.com/su2code/SU2 $name
74+
# Clone only the latest commit, without the Git history. It is much faster this way.
75+
git clone -b master --recursive --depth=1 --shallow-submodules https://github.com/su2code/SU2 $name
7176
cd $name
7277
git config --add remote.origin.fetch '+refs/pull/*/merge:refs/remotes/origin/refs/pull/*/merge'
7378
git config --add remote.origin.fetch '+refs/heads/*:refs/remotes/origin/refs/heads/*'
74-
git fetch origin
79+
git fetch origin --depth=1 $su2branch:$su2branch
7580
git checkout $su2branch
7681
git submodule update
7782
cd ..

0 commit comments

Comments
 (0)