Skip to content

Commit 3bf2da2

Browse files
committed
enhance: auto-select the new HEAD after reword (#2236)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 488e64d commit 3bf2da2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/ViewModels/Reword.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,19 @@ public override async Task<bool> Sure()
6868
.Use(log)
6969
.RunAsync();
7070

71-
if (succ && needAutoStash)
72-
await new Commands.Stash(_repo.FullPath)
73-
.Use(log)
74-
.PopAsync("stash@{0}");
71+
if (succ)
72+
{
73+
if (needAutoStash)
74+
await new Commands.Stash(_repo.FullPath)
75+
.Use(log)
76+
.PopAsync("stash@{0}");
77+
78+
if (_repo.SelectedViewIndex == 0)
79+
{
80+
var head = await new Commands.QueryRevisionByRefName(_repo.FullPath, "HEAD").GetResultAsync();
81+
_repo.NavigateToCommit(head, true);
82+
}
83+
}
7584

7685
log.Complete();
7786
return succ;

0 commit comments

Comments
 (0)