Skip to content

Commit 95b573b

Browse files
bk2204gitster
authored andcommitted
t5605: fix test for cloning from a different user
This test currently passes, but for the wrong reason. The repo_is_hardlinked function expects a .git directory or a bare repository and currently fails because it cannot find the objects directory. One solution is to use the --bare argument, but then --show-toplevel won't work. We could change that, but there's no need to, so just add the missing .git directory. In addition, use the built-in negation functionality of test_grep to avoid mishandling real errors (such as a missing file) and, as a final fix, remove the extra newline. Reported-by: SZEDER Gábor <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0ffb5a6 commit 95b573b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t5605-clone-local.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@ test_expect_success 'cloning a local path with --no-local does not hardlink' '
156156
test_expect_success 'cloning a local path with --no-local from a different user succeeds' '
157157
git clone --upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
158158
--no-local a nonlocal-otheruser 2>err &&
159-
! repo_is_hardlinked nonlocal-otheruser &&
159+
! repo_is_hardlinked nonlocal-otheruser/.git &&
160160
# Verify that this is a git repository.
161161
git -C nonlocal-otheruser rev-parse --show-toplevel &&
162-
! test_grep "detected dubious ownership" err
163-
162+
test_grep ! "detected dubious ownership" err
164163
'
165164

166165
test_expect_success 'cloning locally respects "-u" for fetching refs' '

0 commit comments

Comments
 (0)