Skip to content

Commit a37bb2a

Browse files
committed
Merge branch 'jk/test-curl-updates'
Update HTTP tests to adjust for changes in curl 8.18.0 * jk/test-curl-updates: t5563: add missing end-of-line in HTTP header t5551: handle trailing slashes in expected cookies output
2 parents e7b1925 + 17f4b01 commit a37bb2a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

t/t5551-http-fetch-smart.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ test_expect_success 'dumb clone via http-backend respects namespace' '
333333

334334
test_expect_success 'cookies stored in http.cookiefile when http.savecookies set' '
335335
cat >cookies.txt <<-\EOF &&
336-
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
336+
127.0.0.1 FALSE /smart_cookies FALSE 0 othername othervalue
337337
EOF
338338
sort >expect_cookies.txt <<-\EOF &&
339-
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
340-
127.0.0.1 FALSE /smart_cookies/repo.git/ FALSE 0 name value
341-
127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value
339+
127.0.0.1 FALSE /smart_cookies FALSE 0 othername othervalue
340+
127.0.0.1 FALSE /smart_cookies/repo.git FALSE 0 name value
341+
127.0.0.1 FALSE /smart_cookies/repo.git/info FALSE 0 name value
342342
EOF
343343
git config http.cookiefile cookies.txt &&
344344
git config http.savecookies true &&
@@ -351,8 +351,11 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
351351
tag -m "foo" cookie-tag &&
352352
git fetch $HTTPD_URL/smart_cookies/repo.git cookie-tag &&
353353
354-
grep "^[^#]" cookies.txt | sort >cookies_stripped.txt &&
355-
test_cmp expect_cookies.txt cookies_stripped.txt
354+
# Strip trailing slashes from cookie paths to handle output from both
355+
# old curl ("/smart_cookies/") and new ("/smart_cookies").
356+
HT=" " &&
357+
grep "^[^#]" cookies.txt | sed "s,/$HT,$HT," | sort >cookies_clean.txt &&
358+
test_cmp expect_cookies.txt cookies_clean.txt
356359
'
357360

358361
test_expect_success 'transfer.hiderefs works over smart-http' '

t/t5563-simple-http-auth.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ test_expect_success 'access using basic auth with wwwauth header empty continuat
469469
EOF
470470
'
471471

472-
test_expect_success 'access using basic auth with wwwauth header mixed line-endings' '
472+
test_expect_success 'access using basic auth with wwwauth header mixed continuations' '
473473
test_when_finished "per_test_cleanup" &&
474474
475475
set_credential_reply get <<-EOF &&
@@ -490,7 +490,7 @@ test_expect_success 'access using basic auth with wwwauth header mixed line-endi
490490
printf "id=default response=WWW-Authenticate: FooBar param1=\"value1\"\r\n" >>"$CHALLENGE" &&
491491
printf "id=default response= \r\n" >>"$CHALLENGE" &&
492492
printf "id=default response=\tparam2=\"value2\"\r\n" >>"$CHALLENGE" &&
493-
printf "id=default response=WWW-Authenticate: Basic realm=\"example.com\"" >>"$CHALLENGE" &&
493+
printf "id=default response=WWW-Authenticate: Basic realm=\"example.com\"\r\n" >>"$CHALLENGE" &&
494494
495495
test_config_global credential.helper test-helper &&
496496
git ls-remote "$HTTPD_URL/custom_auth/repo.git" &&

0 commit comments

Comments
 (0)