Handle a local branch that does not yet track a remote

This commit is contained in:
Nick O'Leary
2017-12-04 13:26:47 +00:00
parent 94eeaeb8d3
commit a7e14f1093
3 changed files with 43 additions and 20 deletions

View File

@@ -489,7 +489,12 @@ module.exports = {
},
getRemotes: getRemotes,
getRemoteBranch: function(cwd) {
return runGitCommand(['rev-parse','--abbrev-ref','--symbolic-full-name','@{u}'],cwd)
return runGitCommand(['rev-parse','--abbrev-ref','--symbolic-full-name','@{u}'],cwd).catch(function(err) {
if (/no upstream configured for branch/.test(err.message)) {
return null;
}
throw err;
})
},
getBranches: getBranches,
getBranchInfo: getBranchInfo,