aboutsummaryrefslogtreecommitdiff
path: root/t/t5551-http-fetch-smart.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5551-http-fetch-smart.sh')
-rwxr-xr-xt/t5551-http-fetch-smart.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index b0d4ea7801..a26b6c2844 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -333,12 +333,12 @@ test_expect_success 'dumb clone via http-backend respects namespace' '
test_expect_success 'cookies stored in http.cookiefile when http.savecookies set' '
cat >cookies.txt <<-\EOF &&
- 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
+ 127.0.0.1 FALSE /smart_cookies FALSE 0 othername othervalue
EOF
sort >expect_cookies.txt <<-\EOF &&
- 127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
- 127.0.0.1 FALSE /smart_cookies/repo.git/ FALSE 0 name value
- 127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value
+ 127.0.0.1 FALSE /smart_cookies FALSE 0 othername othervalue
+ 127.0.0.1 FALSE /smart_cookies/repo.git FALSE 0 name value
+ 127.0.0.1 FALSE /smart_cookies/repo.git/info FALSE 0 name value
EOF
git config http.cookiefile cookies.txt &&
git config http.savecookies true &&
@@ -351,8 +351,11 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
tag -m "foo" cookie-tag &&
git fetch $HTTPD_URL/smart_cookies/repo.git cookie-tag &&
- grep "^[^#]" cookies.txt | sort >cookies_stripped.txt &&
- test_cmp expect_cookies.txt cookies_stripped.txt
+ # Strip trailing slashes from cookie paths to handle output from both
+ # old curl ("/smart_cookies/") and new ("/smart_cookies").
+ HT=" " &&
+ grep "^[^#]" cookies.txt | sed "s,/$HT,$HT," | sort >cookies_clean.txt &&
+ test_cmp expect_cookies.txt cookies_clean.txt
'
test_expect_success 'transfer.hiderefs works over smart-http' '
@@ -779,4 +782,11 @@ test_expect_success 'tag following always works over v0 http' '
test_cmp expect actual
'
+test_expect_success 'ls-remote outside repo does not segfault with fetch refspec' '
+ nongit git \
+ -c remote.origin.url="$HTTPD_URL/smart/repo.git" \
+ -c remote.origin.fetch=anything \
+ ls-remote origin
+'
+
test_done