Skip to content

Commit 5060c9d

Browse files
committed
Explain what each step in the init script achieves
This adds comments to init-tests-after-clone.sh to explain what each of the steps is doing that is needed by some of the tests. It also refactors some recently added logic, in a way that lends itself to greater clarity when combined with these comments.
1 parent f6dbba2 commit 5060c9d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

init-tests-after-clone.sh

+15-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ if test -z "$TRAVIS"; then
1313
esac
1414
fi
1515

16+
# Stop if we have run this. (You can delete __testing_point__ to let it rerun.)
17+
# This also keeps track of where we are, so we can get back here.
1618
git tag __testing_point__
19+
20+
# The tests need a branch called master.
1721
git checkout master -- || git checkout -b master
22+
23+
# The tests need a reflog history on the master branch.
1824
git reset --hard HEAD~1
1925
git reset --hard HEAD~1
2026
git reset --hard HEAD~1
27+
28+
# Point the master branch where we started, so we test the correct code.
2129
git reset --hard __testing_point__
2230

23-
test -z "$TRAVIS" || exit 0 # CI jobs will already have taken care of the rest.
31+
# Do some setup that CI takes care of but that may not have been done locally.
32+
if test -z "$TRAVIS"; then
33+
# The tests needs some version tags. Try to get them even in forks.
34+
git fetch --all --tags
2435

25-
git fetch --all --tags
26-
git submodule update --init --recursive
36+
# The tests need submodules, including a submodule with a submodule.
37+
git submodule update --init --recursive
38+
fi

0 commit comments

Comments
 (0)