Skip to content

Commit bf12426

Browse files
committed
fix: prevent target branch HEAD from being changed when adding worktree
Signed-off-by: Gadfly <[email protected]>
1 parent 38e7b69 commit bf12426

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
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();

0 commit comments

Comments
 (0)