From 86c89e0c33dffce16c25a23455239d6997b78188 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 26 Apr 2024 21:05:00 +0800 Subject: [PATCH] feature: use MERGE_MSG as default commit message while merging (#88) --- src/ViewModels/WorkingCopy.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 2a158242..24e733a0 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -274,6 +274,14 @@ namespace SourceGit.ViewModels SelectedStagedTreeNode = null; SetDetail(null, false); } + + // Try to load merge message from MERGE_MSG + if (string.IsNullOrEmpty(_commitMessage)) + { + var mergeMsgFile = Path.Combine(_repo.GitDir, "MERGE_MSG"); + if (File.Exists(mergeMsgFile)) + CommitMessage = File.ReadAllText(mergeMsgFile); + } }); return hasConflict;