aboutsummaryrefslogtreecommitdiffstats
path: root/community/git-lfs2/fix-test-branch-name.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/git-lfs2/fix-test-branch-name.patch')
-rw-r--r--community/git-lfs2/fix-test-branch-name.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/community/git-lfs2/fix-test-branch-name.patch b/community/git-lfs2/fix-test-branch-name.patch
new file mode 100644
index 00000000000..7d5be4c27f0
--- /dev/null
+++ b/community/git-lfs2/fix-test-branch-name.patch
@@ -0,0 +1,46 @@
+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 79a0407..232b001 100644
+--- a/Makefile
++++ b/Makefile
+@@ -478,6 +478,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 270ca12..7624ea9 100644
+--- a/t/testhelpers.sh
++++ b/t/testhelpers.sh
+@@ -361,6 +361,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
+@@ -394,6 +395,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
+
+@@ -559,6 +561,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"