3 test_description='test disabling of local paths in clone/fetch'
5 . "$TEST_DIRECTORY/lib-proto-disable.sh"
7 test_expect_success 'setup repository to clone' '
11 test_proto "file://" file "file://$PWD"
12 test_proto "path" file .
14 test_expect_success 'setup repo with dash' '
15 git init --bare repo.git &&
16 git push repo.git HEAD &&
17 mv repo.git "$PWD/-repo.git"
20 # This will fail even without our rejection because upload-pack will
21 # complain about the bogus option. So let's make sure that GIT_TRACE
22 # doesn't show us even running upload-pack.
24 # We must also be sure to use "fetch" and not "clone" here, as the latter
25 # actually canonicalizes our input into an absolute path (which is fine
27 test_expect_success 'repo names starting with dash are rejected' '
29 test_must_fail env GIT_TRACE="$PWD/trace.out" git fetch -- -repo.git &&
30 ! grep upload-pack trace.out
33 test_expect_success 'full paths still work' '
34 git fetch "$PWD/-repo.git"