Create new branch if guest has unpushed changes

This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-07-10 15:52:47 -07:00
committed by Kevin Sawicki
parent 56b333e7fb
commit 33f538ebf4

View File

@@ -53,7 +53,17 @@ syncRepositoryState = ->
return
else
# prompt for new branch name
# create branch at head
i = 1
loop
newBranch = "#{branch}-#{i++}"
break unless git.hasBranch(newBranch)
command = "git checkout -b #{newBranch} #{head}"
exec command, {cwd: repoPath}, (error, stdout, stderr) ->
if error?
console.error error
return
else
# create branch at head