Skip to content

Commit 88eaa80

Browse files
authored
Merge pull request #155 from github/cmn/skip-on-no-sha256
Skip the SHA256 test if git has not support for it
2 parents 22f1158 + 37ca70f commit 88eaa80

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- name: Set up Go
15-
uses: actions/setup-go@v2
15+
uses: actions/setup-go@v6
1616
with:
17-
go-version: '1.17'
17+
go-version: '1.21.3'
1818

1919
- name: Check out code
2020
uses: actions/checkout@v2

git_sizer_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,11 @@ func TestSHA256(t *testing.T) {
867867
// exist yet:
868868
cmd := exec.Command("git", "init", "--object-format", "sha256", testRepo.Path)
869869
cmd.Env = testutils.CleanGitEnv()
870-
err = cmd.Run()
870+
output, err := cmd.CombinedOutput()
871+
872+
if err != nil && strings.Contains(string(output), "object-format") {
873+
t.Skip("skipping due to lack of SHA256 support")
874+
}
871875
require.NoError(t, err)
872876

873877
timestamp := time.Unix(1112911993, 0)

0 commit comments

Comments
 (0)