We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 432aa70 commit cddcfbfCopy full SHA for cddcfbf
git/native_adapter.go
@@ -112,13 +112,17 @@ func (a nativeGitAdapter) Push(setUpstream bool) error {
112
113
// Create a new branch
114
func (a nativeGitAdapter) Create(b glow.Branch) error {
115
- if !b.CreationIsAllowedFrom(b.BranchName()) {
+ sourceBranch, err := a.CurrentBranch()
116
+ if err != nil {
117
+ return err
118
+ }
119
+ if !b.CreationIsAllowedFrom(sourceBranch.BranchName()) {
120
return errors.New("creation not allowed from this branch")
121
}
122
cmd := a.exec.Command(fmt.Sprintf("git branch %s", b.ShortBranchName()))
123
var stderr bytes.Buffer
124
cmd.Stderr = &stderr
- err := cmd.Run()
125
+ err = cmd.Run()
126
return errors.Wrap(err, stderr.String())
127
128
0 commit comments