Skip to content

Commit 14a5aa5

Browse files
committed
enhance: restore original commit message if target commit changed from pending target to normal reword/edit
Signed-off-by: leo <longshuang@msn.cn>
1 parent e7f391f commit 14a5aa5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ViewModels/InteractiveRebase.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ private void UpdateItems()
386386
if (item.Action == Models.InteractiveRebaseAction.Reword ||
387387
item.Action == Models.InteractiveRebaseAction.Edit)
388388
{
389+
var oldPendingType = item.PendingType;
389390
item.IsFullMessageUsed = true;
390391
item.ShowEditMessageButton = true;
391392
item.PendingType = hasPending ? Models.InteractiveRebasePendingType.Target : Models.InteractiveRebasePendingType.None;
@@ -405,6 +406,11 @@ private void UpdateItems()
405406
hasPending = false;
406407
pendingMessages.Clear();
407408
}
409+
else if (oldPendingType == Models.InteractiveRebasePendingType.Target)
410+
{
411+
if (!item.IsMessageUserEdited)
412+
item.FullMessage = item.OriginalFullMessage;
413+
}
408414

409415
continue;
410416
}

src/Views/InteractiveRebase.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public override void Render(DrawingContext context)
113113
return;
114114

115115
var startW = 4;
116-
var endW = Bounds.Width - 4;
116+
var endW = Bounds.Width - 6;
117117
var height = Bounds.Height;
118118
var halfH = height * 0.5;
119119
var fill = Fill;

0 commit comments

Comments
 (0)