@matheusbsbs / matheus-bagliano / commits / d212cef936
Fork 0

t6050 (replace): fix bogus "fetch branch with replacement" test

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>

Christian Couder committed Sep 26, 2010 at 07:20 UTC d212cef936d689d2a3b0932e678fce255362c72a
1 file changed +10 -3
t/t6050-replace.sh
+10 -3
@@ -205,9 +205,16 @@ test_expect_success 'fetch branch with replacement' '
205 git branch tofetch $HASH6 &&
206 (
207 cd clone_dir &&
208 - git fetch origin refs/heads/tofetch:refs/heads/parallel3
209 - git log --pretty=oneline parallel3 | grep $PARA3
210 - git show $PARA3 | grep "A U Thor"
208 + git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
209 + git log --pretty=oneline parallel3 > output.txt &&
210 + ! grep $PARA3 output.txt &&
211 + git show $PARA3 > para3.txt &&
212 + grep "A U Thor" para3.txt &&
213 + git fetch origin "refs/replace/*:refs/replace/*" &&
214 + git log --pretty=oneline parallel3 > output.txt &&
215 + grep $PARA3 output.txt &&
216 + git show $PARA3 > para3.txt &&
217 + grep "O Thor" para3.txt
218 )
219 '
220