diff --git a/cmd/orb.go b/cmd/orb.go index 11cfef643..55093a9ca 100644 --- a/cmd/orb.go +++ b/cmd/orb.go @@ -1338,6 +1338,13 @@ func initOrb(opts orbOptions) error { return errors.Wrap(err, "Git error") } + branchRef := fmt.Sprintf("refs/heads/%s", gitBranch) + head := plumbing.NewSymbolicReference(plumbing.HEAD, plumbing.ReferenceName(branchRef)) + err = r.Storer.SetReference(head) + if err != nil { + return err + } + w, err := r.Worktree() if err != nil { return err