test: fix for COLUMNS and bash 5
[git/debian.git] / t / t5810-proto-disable-local.sh
blobc1ef99b85c293e8a8bfc0872e3511fe8b7029213
1 #!/bin/sh
3 test_description='test disabling of local paths in clone/fetch'
4 . ./test-lib.sh
5 . "$TEST_DIRECTORY/lib-proto-disable.sh"
7 test_expect_success 'setup repository to clone' '
8 test_commit one
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
26 # to allow).
27 test_expect_success 'repo names starting with dash are rejected' '
28 rm -f trace.out &&
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"
37 test_done