Skip to content

Commit 0c354b6

Browse files
committed
[content-init] When checking out a new local branch (issue context), base it on origin/HEAD
We previously assumed that a prebuild snapshot holds the latest commits, but this changes with incremental prebuilds (where an older prebuild doesn't have the latest commits). Fixes #4167 (comment)
1 parent 295497f commit 0c354b6

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
@@ -98,7 +98,7 @@ func (ws *GitInitializer) realizeCloneTarget(ctx context.Context) (err error) {
9898
return err
9999
}
100100
} else if ws.TargetMode == LocalBranch {
101-
if err := ws.Git(ctx, "checkout", "-b", ws.CloneTarget); err != nil {
101+
if err := ws.Git(ctx, "checkout", "-B", ws.CloneTarget, "origin/HEAD"); err != nil {
102102
return err
103103
}
104104
} else if ws.TargetMode == RemoteCommit {

0 commit comments

Comments
 (0)