diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index e303facd5..4d3b5541c 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -481,7 +481,10 @@ public void Close() { var commitMessage = _workingCopy.CommitMessage; if (!string.IsNullOrEmpty(commitMessage) && _workingCopy.InProgressContext != null) + { File.WriteAllText(Path.Combine(GitDir, "MERGE_MSG"), commitMessage); + commitMessage = string.Empty; // Clears this from ui-state, since it is already saved in MERGE_MSG file. + } _uiStates.LastCommitMessage = commitMessage; _uiStates.Save(); diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index ad663a01b..9b8508bd5 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -817,6 +817,8 @@ private void UpdateInProgressState() if (oldType != null && IsAutoLoadedCommitMessage()) CommitMessage = string.Empty; + else if (string.IsNullOrEmpty(_commitMessage)) + LoadCommitMessageFromFile(Path.Combine(_repo.GitDir, "MERGE_MSG")); return; }