Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5810-proto-disable-local.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5810-proto-disable-local.sh` 38 lines ยท 1032 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='test disabling of local paths in clone/fetch' 4 5 . ./test-lib.sh 6 . "$TEST_DIRECTORY/lib-proto-disable.sh" 7 8 test_expect_success 'setup repository to clone' ' 9 test_commit one 10 ' 11 12 test_proto "file://" file "file://$PWD" 13 test_proto "path" file . 14 15 test_expect_success 'setup repo with dash' ' 16 git init --bare repo.git && 17 git push repo.git HEAD && 18 mv repo.git "$PWD/-repo.git" 19 ' 20 21 # This will fail even without our rejection because upload-pack will 22 # complain about the bogus option. So let's make sure that GIT_TRACE 23 # doesn't show us even running upload-pack. 24 # 25 # We must also be sure to use "fetch" and not "clone" here, as the latter 26 # actually canonicalizes our input into an absolute path (which is fine 27 # to allow). 28 test_expect_success 'repo names starting with dash are rejected' ' 29 rm -f trace.out && 30 test_must_fail env GIT_TRACE="$PWD/trace.out" git fetch -- -repo.git && 31 test_grep ! upload-pack trace.out 32 ' 33 34 test_expect_success 'full paths still work' ' 35 git fetch "$PWD/-repo.git" 36 ' 37 38 test_done