Skip to content

Commit 7b5956f

Browse files
authored
Merge pull request #22 from Axosoft/fix/initialize/preexisting-develop-remote
Use `refs/remotes/origin/<develop>` as <develop>'s upstream, if it exists, when initializing
2 parents 1efee49 + b094873 commit 7b5956f

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)