enhance: restore original commit message if target commit changed from pending target to normal reword/edit

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-10-30 10:42:01 +08:00
parent e7f391f511
commit 14a5aa5f28
2 changed files with 7 additions and 1 deletions

View File

@@ -386,6 +386,7 @@ namespace SourceGit.ViewModels
if (item.Action == Models.InteractiveRebaseAction.Reword ||
item.Action == Models.InteractiveRebaseAction.Edit)
{
var oldPendingType = item.PendingType;
item.IsFullMessageUsed = true;
item.ShowEditMessageButton = true;
item.PendingType = hasPending ? Models.InteractiveRebasePendingType.Target : Models.InteractiveRebasePendingType.None;
@@ -405,6 +406,11 @@ namespace SourceGit.ViewModels
hasPending = false;
pendingMessages.Clear();
}
else if (oldPendingType == Models.InteractiveRebasePendingType.Target)
{
if (!item.IsMessageUserEdited)
item.FullMessage = item.OriginalFullMessage;
}
continue;
}

View File

@@ -113,7 +113,7 @@ namespace SourceGit.Views
return;
var startW = 4;
var endW = Bounds.Width - 4;
var endW = Bounds.Width - 6;
var height = Bounds.Height;
var halfH = height * 0.5;
var fill = Fill;