mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: makes Create New Branch
option as the default selected mode for adding new worktree
This commit is contained in:
parent
db8e534a0a
commit
3e54ab0227
3 changed files with 30 additions and 29 deletions
|
@ -62,7 +62,7 @@ namespace SourceGit.Commands
|
|||
return worktrees;
|
||||
}
|
||||
|
||||
public bool Add(string fullpath, string name, string tracking, Action<string> outputHandler)
|
||||
public bool Add(string fullpath, string name, bool createNew, string tracking, Action<string> outputHandler)
|
||||
{
|
||||
Args = "worktree add ";
|
||||
|
||||
|
@ -70,7 +70,12 @@ namespace SourceGit.Commands
|
|||
Args += "--track ";
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
Args += $"-B {name} ";
|
||||
{
|
||||
if (createNew)
|
||||
Args += $"-b {name} ";
|
||||
else
|
||||
Args += $"-B {name} ";
|
||||
}
|
||||
|
||||
Args += $"\"{fullpath}\" ";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue