aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-06-02 22:17:42 -0700
committerJunio C Hamano <gitster@pobox.com>2008-06-02 23:55:57 -0700
commit67bfc030d7b27c007853776e8028598bdfa2cae0 (patch)
tree8fae799207c6263f9826e333de27fdfd9eb50c51 /t
parent69e66f5500ef6079e3374a6654ef1f6df0c6f360 (diff)
downloadgit-67bfc030d7b27c007853776e8028598bdfa2cae0.tar.gz
git-67bfc030d7b27c007853776e8028598bdfa2cae0.tar.xz
commit: drop duplicated parents
The scripted version of git-commit internally used git-commit-tree which omitted duplicated parents given from the command line. This prevented a nonsensical octopus merge from getting created even when you said "git merge A B" while you are already on branch A. However, when git-commit was rewritten in C, this sanity check was lost. This resurrects it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7502-commit.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 46ec1ce8a..22a13f7aa 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -226,4 +226,18 @@ test_expect_success 'a SIGTERM should break locks' '
! test -f .git/index.lock
'
+rm -f .git/MERGE_MSG .git/COMMIT_EDITMSG
+git reset -q --hard
+
+test_expect_success 'Hand committing of a redundant merge removes dups' '
+
+ git rev-parse second master >expect &&
+ test_must_fail git merge second master &&
+ git checkout master g &&
+ EDITOR=: git commit -a &&
+ git cat-file commit HEAD | sed -n -e "s/^parent //p" -e "/^$/q" >actual &&
+ test_cmp expect actual
+
+'
+
test_done