fix!: raise git required version to 2.13 (#37996)

format `lstrip=2` is only supported in git >= 2.13
https://git-scm.com/docs/git-for-each-ref/2.13.7

ref: #37994

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
wxiaoguang
2026-06-04 21:56:16 +08:00
committed by GitHub
parent aaf4b149fa
commit dac41a124f
5 changed files with 16 additions and 61 deletions

View File

@@ -4,7 +4,6 @@
package git
import (
"os"
"path/filepath"
"strings"
"testing"
@@ -38,7 +37,7 @@ func TestRepository_GetCommitBranches(t *testing.T) {
for _, testCase := range testCases {
commit, err := bareRepo1.GetCommit(testCase.CommitID)
assert.NoError(t, err)
branches, err := bareRepo1.getBranches(os.Environ(), commit.ID.String(), 2)
branches, err := bareRepo1.getBranches(nil, commit.ID.String(), 2)
assert.NoError(t, err)
assert.Equal(t, testCase.ExpectedBranches, branches)
}