summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2013-11-28 19:49:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-09 22:54:47 (GMT)
commit83b058752707a6ba4af51ebc98c47913bc7d2d25 (patch)
tree2c8026c588066e1a1f1b5ce8dae4c18f73c70a29 /t
parent6a59974869c0a6e9399101bc02223b4c00a8aff2 (diff)
downloadgit-83b058752707a6ba4af51ebc98c47913bc7d2d25.zip
git-83b058752707a6ba4af51ebc98c47913bc7d2d25.tar.gz
git-83b058752707a6ba4af51ebc98c47913bc7d2d25.tar.bz2
git_connect(): refactor the port handling for ssh
Use get_host_and_port() even for ssh. Remove the variable port git_connect(), and simplify parse_connect_url() Use only one return point in git_connect(), doing the free() and return conn. t5601 had 2 corner test cases which now pass. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5500-fetch-pack.sh9
-rwxr-xr-xt/t5601-clone.sh10
2 files changed, 4 insertions, 15 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index df5baf8..b4866ea 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -561,20 +561,18 @@ do
do
case "$p" in
*ssh*)
- hh=$(echo $h | tr -d "[]")
pp=ssh
;;
*)
- hh=$h
pp=$p
;;
esac
test_expect_success "fetch-pack --diag-url $p://$h/$r" '
- check_prot_host_path $p://$h/$r $pp "$hh" "/$r"
+ check_prot_host_path $p://$h/$r $pp "$h" "/$r"
'
# "/~" -> "~" conversion
test_expect_success "fetch-pack --diag-url $p://$h/~$r" '
- check_prot_host_path $p://$h/~$r $pp "$hh" "~$r"
+ check_prot_host_path $p://$h/~$r $pp "$h" "~$r"
'
done
done
@@ -604,13 +602,12 @@ do
p=ssh
for h in host [::1]
do
- hh=$(echo $h | tr -d "[]")
test_expect_success "fetch-pack --diag-url $h:$r" '
check_prot_path $h:$r $p "$r"
'
# Do "/~" -> "~" conversion
test_expect_success "fetch-pack --diag-url $h:/~$r" '
- check_prot_host_path $h:/~$r $p "$hh" "~$r"
+ check_prot_host_path $h:/~$r $p "$h" "~$r"
'
done
done
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 4db0c0b..53a1de9 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -364,15 +364,7 @@ do
done
# Corner cases
-# failing
-for url in [foo]bar/baz:qux [foo/bar]:baz
-do
- test_expect_failure "clone $url is not ssh" '
- test_clone_url $url none
- '
-done
-
-for url in foo/bar:baz
+for url in foo/bar:baz [foo]bar/baz:qux [foo/bar]:baz
do
test_expect_success "clone $url is not ssh" '
test_clone_url $url none