From 57fdeaa31726f34e2a3d1c25e97088fa330c7ebf Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Mon, 26 Sep 2022 12:09:00 -0300 Subject: [PATCH] [content-service] Fix checkout local HEAD branch --- components/content-service/pkg/initializer/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/content-service/pkg/initializer/git.go b/components/content-service/pkg/initializer/git.go index 2803d2eca7b6a7..360eada5dfa6e7 100644 --- a/components/content-service/pkg/initializer/git.go +++ b/components/content-service/pkg/initializer/git.go @@ -192,7 +192,7 @@ func (ws *GitInitializer) realizeCloneTarget(ctx context.Context) (err error) { } case LocalBranch: // checkout local branch based on remote HEAD - if err := ws.Git(ctx, "checkout", "origin/HEAD", "--no-track"); err != nil { + if err := ws.Git(ctx, "checkout", "-B", ws.CloneTarget, "origin/HEAD", "--no-track"); err != nil { return err } case RemoteCommit: