提交 6c0e397d 编写于 作者: J Jingwen Owen Ou

Check null of trackedBranch

上级 da534515
...@@ -114,7 +114,7 @@ func pullRequest(cmd *Command, args *Args) { ...@@ -114,7 +114,7 @@ func pullRequest(cmd *Command, args *Args) {
base = masterBranch.ShortName() base = masterBranch.ShortName()
} }
if head == "" { if head == "" && trackedBranch != nil {
if !trackedBranch.IsRemote() { if !trackedBranch.IsRemote() {
// the current branch tracking another branch // the current branch tracking another branch
// pretend there's no upstream at all // pretend there's no upstream at all
...@@ -127,11 +127,12 @@ func pullRequest(cmd *Command, args *Args) { ...@@ -127,11 +127,12 @@ func pullRequest(cmd *Command, args *Args) {
} }
} }
if trackedBranch == nil { }
head = currentBranch.ShortName()
} else { if trackedBranch == nil {
head = trackedBranch.ShortName() head = currentBranch.ShortName()
} } else {
head = trackedBranch.ShortName()
} }
title, body, err := getTitleAndBodyFromFlags(flagPullRequestMessage, flagPullRequestFile) title, body, err := getTitleAndBodyFromFlags(flagPullRequestMessage, flagPullRequestFile)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册