aboutsummaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-28 13:51:11 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-28 13:51:11 -0700
commit9abf65d23ce8700c290fa4f7d834a10ec5b3e327 (patch)
tree8a378ca3c195c00c4f43a30ea89f3c12d844bf38 /builtin/merge.c
parentb2273d06033e5989ca30a72492ca894d0416354f (diff)
parentb549be0da7ff9075c0b3de14c1d5d03583ca8d2d (diff)
downloadgit-9abf65d23ce8700c290fa4f7d834a10ec5b3e327.tar.gz
git-9abf65d23ce8700c290fa4f7d834a10ec5b3e327.tar.xz
Merge branch 'bp/commit-p-editor'
When it is not necessary to edit a commit log message (e.g. "git commit -m" is given a message without specifying "-e"), we used to disable the spawning of the editor by overriding GIT_EDITOR, but this means all the uses of the editor, other than to edit the commit log message, are also affected. * bp/commit-p-editor: run-command: mark run_hook_with_custom_index as deprecated merge hook tests: fix and update tests merge: fix GIT_EDITOR override for commit hook commit: fix patch hunk editing with "commit -p -m" test patch hunk editing with "commit -p -m" merge hook tests: use 'test_must_fail' instead of '!' merge hook tests: fix missing '&&' in test
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index f0cf1205f..e15d0e145 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -421,7 +421,7 @@ static void finish(struct commit *head_commit,
}
/* Run a post-merge hook */
- run_hook(NULL, "post-merge", squash ? "1" : "0", NULL);
+ run_hook_le(NULL, "post-merge", squash ? "1" : "0", NULL);
strbuf_release(&reflog_message);
}
@@ -824,8 +824,8 @@ static void prepare_to_commit(struct commit_list *remoteheads)
if (0 < option_edit)
strbuf_commented_addf(&msg, _(merge_editor_comment), comment_line_char);
write_merge_msg(&msg);
- if (run_hook(get_index_file(), "prepare-commit-msg",
- git_path("MERGE_MSG"), "merge", NULL, NULL))
+ if (run_commit_hook(0 < option_edit, get_index_file(), "prepare-commit-msg",
+ git_path("MERGE_MSG"), "merge", NULL))
abort_commit(remoteheads, NULL);
if (0 < option_edit) {
if (launch_editor(git_path("MERGE_MSG"), NULL, NULL))