1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 18:25:41 +03:00
aports/community/git-lfs/fix-test-branch-name.patch
2022-11-20 07:51:28 +00:00

46 lines
1.4 KiB
Diff

for some reasons, tests expect the default branch to be called 'main',
while on alpine it's still 'master'.
to fix this, we can just rename the branch after cloning a test repo to 'main'.
diff --git a/Makefile b/Makefile
index 0b73d9e..33503c0 100644
--- a/Makefile
+++ b/Makefile
@@ -565,6 +565,7 @@ test : fmt $(.DEFAULT_GOAL)
tempdir="$$(mktemp -d)"; \
export HOME="$$tempdir"; \
export GIT_CONFIG_NOSYSTEM=1; \
+ git config --global init.defaultBranch main; \
$(GO) test -count=1 $(GO_TEST_EXTRA_ARGS) $(addprefix ./,$(PKGS)); \
RET=$$?; \
chmod -R u+w "$$tempdir"; \
diff --git a/t/testhelpers.sh b/t/testhelpers.sh
index 7c921f4..a1803d9 100644
--- a/t/testhelpers.sh
+++ b/t/testhelpers.sh
@@ -419,6 +419,7 @@ clone_repo() {
echo "clone local git repository $reponame to $dir"
out=$(git clone "$GITSERVER/$reponame" "$dir" 2>&1)
cd "$dir"
+ git branch -m main
git config credential.helper lfstest
echo "$out" > clone.log
@@ -452,6 +453,7 @@ clone_repo_ssl() {
echo "clone local git repository $reponame to $dir"
out=$(git clone "$SSLGITSERVER/$reponame" "$dir" 2>&1)
cd "$dir"
+ git branch -m main
git config credential.helper lfstest
@@ -617,6 +619,8 @@ setup() {
write_creds_file ":pass" "$CREDSDIR/--$certpath"
write_creds_file ":pass" "$CREDSDIR/--$keypath"
+ git config --global init.defaultBranch main
+
echo "#"
echo "# HOME: $HOME"
echo "# TMP: $TMPDIR"