Skip to content

Commit 81dbbb2

Browse files
authored
Merge pull request #22 from albinekb/fix/merge-message
🐛 Launch default editor for merge commit message
2 parents eef4d9e + 3d45a49 commit 81dbbb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/main.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ enum OutPath {
230230
EditMessage(PathBuf),
231231
RebaseTodo(PathBuf),
232232
AddPHunkEdit(PathBuf),
233+
MergeMessage(PathBuf),
233234
}
234235

235236
impl FromStr for OutPath {
@@ -242,6 +243,8 @@ impl FromStr for OutPath {
242243
Ok(OutPath::RebaseTodo(path))
243244
} else if path.ends_with(".git/addp-hunk-edit.diff") {
244245
Ok(OutPath::AddPHunkEdit(path))
246+
} else if path.ends_with(".git/MERGE_MSG") {
247+
Ok(OutPath::MergeMessage(path))
245248
} else {
246249
Err(format!("Must end with one of the following: \r\n\t{}\r\n\t{}\r\n\t{}\r\nGot the following path: {:?}", ".git/COMMIT_EDITMSG", ".git/rebase-merge/git-rebase-todo", ".git/addp-hunk-edit.diff", path))
247250
}
@@ -274,7 +277,7 @@ fn main() -> Result<(), Box<dyn Error>> {
274277
Ok(())
275278
},
276279
Opt {
277-
out_path: Some(OutPath::RebaseTodo(out_path) | OutPath::AddPHunkEdit(out_path)),
280+
out_path: Some(OutPath::RebaseTodo(out_path) | OutPath::AddPHunkEdit(out_path) | OutPath::MergeMessage(out_path)),
278281
refspecs: None,
279282
} => {
280283
launch_default_editor(out_path);

0 commit comments

Comments
 (0)