Skip to content

Commit d212cef

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831a8b8 commit d212cef

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

t/t6050-replace.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,16 @@ test_expect_success 'fetch branch with replacement' '
205205
git branch tofetch $HASH6 &&
206206
(
207207
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
211218
)
212219
'
213220

0 commit comments

Comments
 (0)