Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func gitCheckout(ctx context.Context, sh shellRunner, gitCheckoutFlags, referenc
return fmt.Errorf("%q is not a valid git ref format", reference)
}

commandArgs := []string{"checkout"}
commandArgs := []string{"-c", "advice.detachedHead=false", "checkout"}
commandArgs = append(commandArgs, individualCheckoutFlags...)
commandArgs = append(commandArgs, reference)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func TestGitCheckoutValidatesRef(t *testing.T) {
}

func TestGitCheckout(t *testing.T) {
sh := new(mockShellRunner).Expect("git", "checkout", "-f", "-q", "main")
sh := new(mockShellRunner).Expect("git", "-c", "advice.detachedHead=false", "checkout", "-f", "-q", "main")
defer sh.Check(t)
err := gitCheckout(context.Background(), sh, "-f -q", "main")
require.NoError(t, err)
Expand Down