Commits

Anonymous committed 5a62b53 Merge

Merge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint

* jc/merge-ff-only-stronger-than-signed-merge:
merge: do not create a signed tag merge under --ff-only option

  • Participants
  • Parent commits 8eb865b, b5c9f1c
  • Branches maint

Comments (0)

Files changed (2)

File builtin/merge.c

 			    sha1_to_hex(commit->object.sha1));
 		setenv(buf.buf, argv[i], 1);
 		strbuf_reset(&buf);
-		if (merge_remote_util(commit) &&
+		if (!fast_forward_only &&
+		    merge_remote_util(commit) &&
 		    merge_remote_util(commit)->obj &&
 		    merge_remote_util(commit)->obj->type == OBJ_TAG) {
 			option_edit = 1;

File t/t7600-merge.sh

 '
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-gpg.sh
 
 printf '%s\n' 1 2 3 4 5 6 7 8 9 >file
 printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >file.1
 	test_cmp actual expected
 '
 
+test_expect_success GPG 'merge --ff-only tag' '
+	git reset --hard c0 &&
+	git commit --allow-empty -m "A newer commit" &&
+	git tag -s -m "A newer commit" signed &&
+	git reset --hard c0 &&
+
+	git merge --ff-only signed &&
+	git rev-parse signed^0 >expect &&
+	git rev-parse HEAD >actual &&
+	test_cmp actual expect
+'
+
 test_done