Skip to content

Commit 02adf84

Browse files
peffgitster
authored andcommitted
t5570: use ls-remote instead of clone for interp tests
We don't actually care about the clone operation here; we just want to know if we were able to actually contact the remote repository. Using ls-remote does that more efficiently, and without us having to worry about managing the tmp.git directory. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8279ed0 commit 02adf84

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

t/t5570-git-daemon.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,20 @@ test_expect_success 'access repo via interpolated hostname' '
167167
git init --bare "$repo" &&
168168
git push "$repo" HEAD &&
169169
>"$repo"/git-daemon-export-ok &&
170-
rm -rf tmp.git &&
171170
GIT_OVERRIDE_VIRTUAL_HOST=localhost \
172-
git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git &&
173-
rm -rf tmp.git &&
171+
git ls-remote "$GIT_DAEMON_URL/interp.git" &&
174172
GIT_OVERRIDE_VIRTUAL_HOST=LOCALHOST \
175-
git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git
173+
git ls-remote "$GIT_DAEMON_URL/interp.git"
176174
'
177175

178176
test_expect_success 'hostname cannot break out of directory' '
179-
rm -rf tmp.git &&
180177
repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/../escape.git" &&
181178
git init --bare "$repo" &&
182179
git push "$repo" HEAD &&
183180
>"$repo"/git-daemon-export-ok &&
184181
test_must_fail \
185182
env GIT_OVERRIDE_VIRTUAL_HOST=.. \
186-
git clone --bare "$GIT_DAEMON_URL/escape.git" tmp.git
183+
git ls-remote "$GIT_DAEMON_URL/escape.git"
187184
'
188185

189186
stop_git_daemon

0 commit comments

Comments
 (0)