Skip to content

Commit 6482ef2

Browse files
authored
fix: prevent target branch HEAD from being changed when adding worktree (#919)
* fix: prevent target branch HEAD from being changed when adding worktree Signed-off-by: Gadfly <[email protected]> * fix: worktree path validator trigger error Signed-off-by: Gadfly <[email protected]> --------- Signed-off-by: Gadfly <[email protected]>
1 parent 38e7b69 commit 6482ef2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Commands/Worktree.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public bool Add(string fullpath, string name, bool createNew, string tracking, A
7373

7474
if (!string.IsNullOrEmpty(tracking))
7575
Args += tracking;
76+
else if (!string.IsNullOrEmpty(name) && !createNew)
77+
Args += name;
7678

7779
_outputHandler = outputHandler;
7880
return Exec();

src/ViewModels/AddWorktree.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class AddWorktree : Popup
1212
public string Path
1313
{
1414
get => _path;
15-
set => SetProperty(ref _path, value);
15+
set => SetProperty(ref _path, value, true);
1616
}
1717

1818
public bool CreateNewBranch

0 commit comments

Comments
 (0)