summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-17 06:56:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-18 21:02:03 (GMT)
commit94d63ce2abfd8de9dc3c928383270ec6ca3605bb (patch)
treeb0a093dd61306f26e483f6a146f1415755d38065 /t/t7600-merge.sh
parentff372c7851f36bfe0e113e23d247cb9033e79559 (diff)
downloadgit-94d63ce2abfd8de9dc3c928383270ec6ca3605bb.zip
git-94d63ce2abfd8de9dc3c928383270ec6ca3605bb.tar.gz
git-94d63ce2abfd8de9dc3c928383270ec6ca3605bb.tar.bz2
t7600 (merge): test merge from branch yet to be born
Some people like to "git fetch origin && merge origin/master" from the unborn branch provided when first initializing a repository. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 6e839a6..b4f40e4 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -173,6 +173,27 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
test_debug 'git log --graph --decorate --oneline --all'
+test_expect_success 'merge from unborn branch' '
+ git checkout -f master &&
+ test_might_fail git branch -D kid &&
+
+ echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
+
+ git checkout --orphan kid &&
+ test_when_finished "git checkout -f master" &&
+ git rm -fr . &&
+ test_tick &&
+ git merge --ff-only c1 &&
+ verify_merge file result.1 &&
+ verify_head "$c1" &&
+
+ git reflog -1 >reflog.actual &&
+ sed "s/$_x05[0-9a-f][0-9a-f]/OBJID/g" reflog.actual >reflog.fuzzy &&
+ test_cmp reflog.expected reflog.fuzzy
+'
+
+test_debug 'git log --graph --decorate --oneline --all'
+
test_expect_success 'merge c1 with c2' '
git reset --hard c1 &&
test_tick &&