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/t5813-proto-disable-ssh.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 / t5813-proto-disable-ssh.sh` 44 lines ยท 1322 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='test disabling of git-over-ssh in clone/fetch' 4 5 . ./test-lib.sh 6 . "$TEST_DIRECTORY/lib-proto-disable.sh" 7 8 setup_ssh_wrapper 9 10 test_expect_success 'setup repository to clone' ' 11 test_commit one && 12 mkdir remote && 13 git init --bare remote/repo.git && 14 git push remote/repo.git HEAD 15 ' 16 17 test_proto "host:path" ssh "remote:repo.git" 18 test_proto "ssh://" ssh "ssh://remote$PWD/remote/repo.git" 19 test_proto "git+ssh://" ssh "git+ssh://remote$PWD/remote/repo.git" 20 21 # Don't even bother setting up a "-remote" directory, as ssh would generally 22 # complain about the bogus option rather than completing our request. Our 23 # fake wrapper actually _can_ handle this case, but it's more robust to 24 # simply confirm from its output that it did not run at all. 25 test_expect_success 'hostnames starting with dash are rejected' ' 26 test_must_fail git clone ssh://-remote/repo.git dash-host 2>stderr && 27 test_grep ! ^ssh: stderr 28 ' 29 30 test_expect_success 'setup repo with dash' ' 31 git init --bare remote/-repo.git && 32 git push remote/-repo.git HEAD 33 ' 34 35 test_expect_success 'repo names starting with dash are rejected' ' 36 test_must_fail git clone remote:-repo.git dash-path 2>stderr && 37 test_grep ! ^ssh: stderr 38 ' 39 40 test_expect_success 'full paths still work' ' 41 git clone "remote:$PWD/remote/-repo.git" dash-path 42 ' 43 44 test_done