1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-10-30 23:58:09 +02:00

test: make test git init compatible with older git versions

Signed-off-by: Carlos Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Becker
2021-04-25 02:21:54 +00:00
parent 4a40c1550d
commit 48e8d83dad

View File

@@ -11,10 +11,12 @@ import (
// GitInit inits a new git project.
func GitInit(tb testing.TB) {
tb.Helper()
out, err := fakeGit("init", "-b", "main")
out, err := fakeGit("init")
require.NoError(tb, err)
require.Contains(tb, out, "Initialized empty Git repository")
require.NoError(tb, err)
GitCheckoutBranch(tb, "main")
_, _ = fakeGit("branch", "-D", "master")
}
// GitRemoteAdd adds the given url as remote.