Skip to content

Commit 2d90add

Browse files
peffgitster
authored andcommitted
t5813: add test for hostname starting with dash
Per the explanation in the previous patch, this should be (and is) rejected. Signed-off-by: Jeff King <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 820d765 commit 2d90add

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/t5813-proto-disable-ssh.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,13 @@ test_proto "host:path" ssh "remote:repo.git"
1717
test_proto "ssh://" ssh "ssh://remote$PWD/remote/repo.git"
1818
test_proto "git+ssh://" ssh "git+ssh://remote$PWD/remote/repo.git"
1919

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.
24+
test_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+
2029
test_done

0 commit comments

Comments
 (0)