aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-03-02 20:13:20 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-04-29 18:42:28 -0400
commit401e60f2893d689772f716cbd800ee2ee0309362 (patch)
treee4fa0eb76be9d138b5fe757ed20292af32e50f80 /tests
parent4bb111c8d4c5692db2f735c2803f632f8c30b6ab (diff)
Resolve reference for remote repository
Resolves the HEAD reference from the remote repository instead of assuming "master".
Diffstat (limited to 'tests')
-rw-r--r--tests/flakes.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh
index 46e6a7982..24601784f 100644
--- a/tests/flakes.sh
+++ b/tests/flakes.sh
@@ -31,7 +31,14 @@ flakeFollowsE=$TEST_ROOT/follows/flakeA/flakeE
for repo in $flake1Dir $flake2Dir $flake3Dir $flake7Dir $templatesDir $nonFlakeDir $flakeA $flakeB $flakeFollowsA; do
rm -rf $repo $repo.tmp
mkdir -p $repo
- git -C $repo init
+
+ # Give one repo a non-master initial branch.
+ extraArgs=
+ if [[ $repo == $flake2Dir ]]; then
+ extraArgs="--initial-branch=main"
+ fi
+
+ git -C $repo init $extraArgs
git -C $repo config user.email "foobar@example.com"
git -C $repo config user.name "Foobar"
done