A3: offer git's prepared merge message in the commit box

git.mergeMessage reads MERGE_MSG without its comment lines while a merge
is in progress. The Changes window fills an empty box with it once per
merge when conflicts show up, and again on vcs.commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-31 14:25:11 +01:00
parent 95fd9b926f
commit 983319d8a3
7 changed files with 183 additions and 2 deletions

View file

@ -127,10 +127,14 @@ fn a_conflict_its_versions_resolving_and_committing() {
init(root);
conflicting(root);
let repo = open(&cli, root);
assert_eq!(repo.merge_message().unwrap(), None);
let outcome = repo.merge("feature").unwrap();
assert_eq!(outcome.result, MergeResult::Conflicts);
assert_eq!(outcome.conflicts, vec!["a.php"]);
assert!(repo.merging().unwrap());
let prepared = repo.merge_message().unwrap().unwrap();
assert!(prepared.starts_with("Merge branch 'feature'"), "{prepared}");
assert!(!prepared.contains('#'), "{prepared}");
let status = repo.status().unwrap();
let file = status.files.iter().find(|f| f.path == "a.php").unwrap();
assert_eq!(file.worktree, FileState::Conflicted);
@ -160,6 +164,7 @@ fn a_conflict_its_versions_resolving_and_committing() {
));
repo.commit("Merge feature", false).unwrap();
assert!(!repo.merging().unwrap());
assert_eq!(repo.merge_message().unwrap(), None);
assert_eq!(git(root, &["rev-list", "--count", "--merges", "HEAD"]), "1");
}