summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-13 19:42:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-13 19:42:11 (GMT)
commit5a62b531ae1fda10d023082cb73a5440dbd54df1 (patch)
tree42895bf2539d5bf3ed6e17936d19679ffd2a9f6c
parent8eb865ba8a24aad5380a23fc1e331aba2f7c5bbb (diff)
parentb5c9f1c1b0ed9c91463b9f46a7c9dff3efc53773 (diff)
downloadgit-5a62b531ae1fda10d023082cb73a5440dbd54df1.zip
git-5a62b531ae1fda10d023082cb73a5440dbd54df1.tar.gz
git-5a62b531ae1fda10d023082cb73a5440dbd54df1.tar.bz2
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
-rw-r--r--builtin/merge.c3
-rwxr-xr-xt/t7600-merge.sh13
2 files changed, 15 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 3a45172..b4fbc60 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1283,7 +1283,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
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;
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 5d8c428..a598dfa 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -27,6 +27,7 @@ Testing basic merge operations/option parsing.
'
. ./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
@@ -670,4 +671,16 @@ test_expect_success 'merge --no-ff --edit' '
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