mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
fix<*>: fix crash while creating branch with empty repository
This commit is contained in:
parent
284e8077d6
commit
f4237efaa2
4 changed files with 43 additions and 36 deletions
|
@ -13,10 +13,10 @@ namespace SourceGit.Commands {
|
|||
var current = branches.Find(x => x.IsCurrent);
|
||||
|
||||
var masterBranch = branches.Find(x => x.Name == master);
|
||||
if (masterBranch == null) new Branch(Cwd, master).Create(current.Head);
|
||||
if (masterBranch == null && current != null) new Branch(Cwd, develop).Create(current.Head);
|
||||
|
||||
var devBranch = branches.Find(x => x.Name == develop);
|
||||
if (devBranch == null) new Branch(Cwd, develop).Create(current.Head);
|
||||
if (devBranch == null && current != null) new Branch(Cwd, develop).Create(current.Head);
|
||||
|
||||
var cmd = new Config(Cwd);
|
||||
cmd.Set("gitflow.branch.master", master);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue