Skip to content

Commit df66bac

Browse files
committed
enhance: reset commit message after a merge request has been aborted
1 parent 1509b8a commit df66bac

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/ViewModels/InProgressContexts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public InProgressContext(string repo, string cmd)
2222
Cmd = cmd;
2323
}
2424

25-
public void Abort()
25+
public bool Abort()
2626
{
27-
new Commands.Command()
27+
return new Commands.Command()
2828
{
2929
WorkingDirectory = Repository,
3030
Context = Repository,

src/ViewModels/Repository.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,11 @@ public async void AbortMerge()
511511
if (_inProgressContext != null)
512512
{
513513
SetWatcherEnabled(false);
514-
await Task.Run(_inProgressContext.Abort);
514+
var succ = await Task.Run(_inProgressContext.Abort);
515+
if (succ && _workingCopy != null)
516+
{
517+
_workingCopy.CommitMessage = string.Empty;
518+
}
515519
SetWatcherEnabled(true);
516520
}
517521
else

0 commit comments

Comments
 (0)