merge: force edit and no-ff mode when merging a tag object

Now that we allow pulling a tag from the remote site to validate the authenticity, we should give the user the final chance to verify and edit the merge message. The integrator is expected to leave a meaningful merge commit log in the history. Disallow fast-forwarding in such a case to ensure that a merge commit is always recorded. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 7, 2011 at 16:29 UTC fab47d057559301c74d6642576694fd251a3fd11
1 file changed +6
builtin/merge.c
+6
@@ -1253,6 +1253,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1253 sha1_to_hex(commit->object.sha1));
1254 setenv(buf.buf, argv[i], 1);
1255 strbuf_reset(&buf);
1256 + if (merge_remote_util(commit) &&
1257 + merge_remote_util(commit)->obj &&
1258 + merge_remote_util(commit)->obj->type == OBJ_TAG) {
1259 + option_edit = 1;
1260 + allow_fast_forward = 0;
1261 + }
1262 }
1263
1264 if (!use_strategies) {