[PATCH] Add new testcase to show that fast-export can squash merge commits
- From
newren@gmail.com <newren@gmail.com>
- Date
- Feb 11, 2009, 06:03 UTC
- Message-ID
- <1234332233-10017-1-git-send-email-newren@gmail.com>
From: Elijah Newren <newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
I'm not certain this testcase will actually trigger the bug for everyone,
since I don't know the order of commits used by git rev-list. It does
trigger it for me. What you need is a history that looks like
B--D
/ /
A--C
with the master branch pointing at D, and have "git rev-list --all" show
these commits in the order
C
D
B
A
If you have such a repository, "git fast-export --all" will give
instructions to create a master branch that only contains D, B, and A.
t/t9301-fast-export.sh | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh index 9985721..a1ee400 100755 --- a/t/t9301-fast-export.sh +++ b/t/t9301-fast-export.sh @@ -259,4 +259,33 @@ test_expect_success 'cope with tagger-less tags' ' ' +test_expect_success 'avoid squashing merges' ' + + mkdir repo && + cd repo && + git init && + echo fee-fi-fo-fum > giant && + git add giant && + git commit -m "Initial commit" && + git branch alternate_root && + echo hello > world && + git add world && + git commit -m "Commit on master" && + git checkout alternate_root && + echo foo > bar && + git add bar && + git commit -m "Commit on alternate_root" && + git checkout master && + git merge alternate_root && + MASTER=$(git rev-parse --verify refs/heads/master) && + rm -rf ../new && + mkdir ../new && + git --git-dir=../new/.git init && + git fast-export --all | + (cd ../new && + git fast-import && + test $MASTER = $(git rev-parse --verify refs/heads/master)) + +' + test_done
-- 1.6.0.6