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