Skip to content

Commit 3af7d6c

Browse files
committed
Fix git getter version test for git builds with metadata
1 parent d066292 commit 3af7d6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

get_git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func checkGitVersion(min string) error {
224224
}
225225

226226
fields := strings.Fields(string(out))
227-
if len(fields) != 3 {
227+
if len(fields) < 3 {
228228
return fmt.Errorf("Unexpected 'git version' output: %q", string(out))
229229
}
230230

get_git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func TestGitGetter_gitVersion(t *testing.T) {
204204
script := filepath.Join(dir, "git")
205205
err = ioutil.WriteFile(
206206
script,
207-
[]byte("#!/bin/sh\necho git version 2.0\n"),
207+
[]byte("#!/bin/sh\necho \"git version 2.0 (Some Metadata Here)\n\""),
208208
0700)
209209
if err != nil {
210210
t.Fatal(err)

0 commit comments

Comments
 (0)