From fd5ec345957965fc2f467039f5bf17caeacdbc7e Mon Sep 17 00:00:00 2001 From: Mitsuyuki Shiiba Date: Sun, 20 Mar 2022 18:22:07 +0900 Subject: [PATCH] Change to use gitBranch instead of default master --- cmd/orb.go | 7 +++++++ 1 file changed, 7 insertions(+) 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