Skip to content

Commit

Permalink
t7600 (merge): test merge from branch yet to be born
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Aug 18, 2010
1 parent ff372c7 commit 94d63ce
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/t7600-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 94d63ce

Please sign in to comment.