summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-12 22:41:51 -0800
committerJunio C Hamano <gitster@pobox.com>2012-02-12 22:41:51 -0800
commit5cdc9fbb0894023da8e4dab552dfdda8b662feab (patch)
tree9c4c577d565a76e2af67903d4cf0e98a3d416c14
parentb6b3b6a01f357922ccd14f2615accc9bd39fc194 (diff)
parent3adab6f3a7793253b22a4a7aae34221d19e0236a (diff)
downloadgit-5cdc9fbb0894023da8e4dab552dfdda8b662feab.tar.gz
Merge branch 'jn/merge-no-edit-fix'
* jn/merge-no-edit-fix: merge: do not launch an editor on "--no-edit $tag" Conflicts: builtin/merge.c
-rw-r--r--builtin/merge.c3
-rwxr-xr-xt/t7600-merge.sh12
2 files changed, 14 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 7e6db3bb35..ed0f959ac4 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1324,7 +1324,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
merge_remote_util(commit) &&
merge_remote_util(commit)->obj &&
merge_remote_util(commit)->obj->type == OBJ_TAG) {
- option_edit = 1;
+ if (option_edit < 0)
+ option_edit = 1;
allow_fast_forward = 0;
}
}
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index a598dfa477..9e27bbf902 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -683,4 +683,16 @@ test_expect_success GPG 'merge --ff-only tag' '
test_cmp actual expect
'
+test_expect_success GPG 'merge --no-edit tag should skip editor' '
+ git reset --hard c0 &&
+ git commit --allow-empty -m "A newer commit" &&
+ git tag -f -s -m "A newer commit" signed &&
+ git reset --hard c0 &&
+
+ EDITOR=false git merge --no-edit signed &&
+ git rev-parse signed^0 >expect &&
+ git rev-parse HEAD^2 >actual &&
+ test_cmp actual expect
+'
+
test_done