Skip to content

Commit

Permalink
t6050 (replace): fix bogus "fetch branch with replacement" test
Browse files Browse the repository at this point in the history
The test was missing some "&&" at the end of some lines and it
was wrong because, as the replacement refs were not fetched,
the commits from the parallel branch should not show up. This
was found by Elijah Newren.

This is fixed by checking that after the branch from HASH6 is
fetched, the commits from the parallel branch don't show up,
and then by fetching the replacement refs and checking that
they do show up afterwards.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Sep 27, 2010
1 parent 831a8b8 commit d212cef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions t/t6050-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,16 @@ test_expect_success 'fetch branch with replacement' '
git branch tofetch $HASH6 &&
(
cd clone_dir &&
git fetch origin refs/heads/tofetch:refs/heads/parallel3
git log --pretty=oneline parallel3 | grep $PARA3
git show $PARA3 | grep "A U Thor"
git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
git log --pretty=oneline parallel3 > output.txt &&
! grep $PARA3 output.txt &&
git show $PARA3 > para3.txt &&
grep "A U Thor" para3.txt &&
git fetch origin "refs/replace/*:refs/replace/*" &&
git log --pretty=oneline parallel3 > output.txt &&
grep $PARA3 output.txt &&
git show $PARA3 > para3.txt &&
grep "O Thor" para3.txt
)
'

Expand Down

0 comments on commit d212cef

Please sign in to comment.