Skip to content

Commit b094873

Browse files
author
Joshua Grosso
committed
Use refs/remotes/origin/<develop> as <develop>'s upstream, if it exists, when initializing
1 parent 1efee49 commit b094873

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Base.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ class Base {
9494
.then(() => {
9595
// Create the `develop` branch if it does not already exist
9696
return NodeGit.Branch.lookup(repo, developBranchName, NodeGit.Branch.BRANCH.LOCAL)
97-
.catch(() => repo.getBranchCommit(masterBranchName)
98-
.then((commit) => repo.createBranch(developBranchName, commit.id())));
97+
.catch(() => repo.getBranchCommit(`refs/remotes/origin/${developBranchName}`))
98+
.catch(() => repo.getBranchCommit(masterBranchName))
99+
.then((commit) => repo.createBranch(developBranchName, commit.id()));
99100
})
100101
.then(() => repo.config())
101102
.then((config) => {

0 commit comments

Comments
 (0)