Skip to content

Commit fab47d0

Browse files
committed
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 <[email protected]>
1 parent 5231c63 commit fab47d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

builtin/merge.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
12531253
sha1_to_hex(commit->object.sha1));
12541254
setenv(buf.buf, argv[i], 1);
12551255
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+
}
12561262
}
12571263

12581264
if (!use_strategies) {

0 commit comments

Comments
 (0)