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 <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jul 28, 2017 at 15:23 UTC
2d90add5ad216807ec1433e5367fae730e74a4cb
1 file changed
+9
t/t5813-proto-disable-ssh.sh
+9
@@ -17,4 +17,13 @@ test_proto "host:path" ssh "remote:repo.git"
17
test_proto "ssh://" ssh "ssh://remote$PWD/remote/repo.git"
18
test_proto "git+ssh://" ssh "git+ssh://remote$PWD/remote/repo.git"
19
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
+
29
test_done