Skip to content

Commit 57fdeaa

Browse files
aledbfroboquat
authored andcommitted
[content-service] Fix checkout local HEAD branch
1 parent 1537260 commit 57fdeaa

File tree

1 file changed

+1
-1
lines changed
  • components/content-service/pkg/initializer

1 file changed

+1
-1
lines changed

components/content-service/pkg/initializer/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (ws *GitInitializer) realizeCloneTarget(ctx context.Context) (err error) {
192192
}
193193
case LocalBranch:
194194
// checkout local branch based on remote HEAD
195-
if err := ws.Git(ctx, "checkout", "origin/HEAD", "--no-track"); err != nil {
195+
if err := ws.Git(ctx, "checkout", "-B", ws.CloneTarget, "origin/HEAD", "--no-track"); err != nil {
196196
return err
197197
}
198198
case RemoteCommit:

0 commit comments

Comments
 (0)