Skip to content

Commit 29e8dc5

Browse files
tgummerergitster
authored andcommitted
t5551: compare sorted cookies files
In t5551 we check that we save cookies correctly to a file when http.cookiefile and http.savecookies are set. To do so we create an expect file that expects the cookies in a certain order. However after e2ef8d6fa ("cookies: support creation-time attribute for cookies", 2018-08-28) in curl.git (released in curl 7.61.1) that order changed. We document the file format as "Netscape/Mozilla cookie file format (see curl(1))", so any format produced by libcurl should be fine here. Sort the files, to be agnostic to the order of the cookies, and make the test pass with both curl versions > 7.61.1 and earlier curl versions. Reported-by: Todd Zullinger <[email protected]> Helped-by: Jonathan Nieder <[email protected]> Signed-off-by: Thomas Gummerer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92b7fd8 commit 29e8dc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t5551-http-fetch-smart.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
207207
cat >cookies.txt <<-\EOF &&
208208
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
209209
EOF
210-
cat >expect_cookies.txt <<-\EOF &&
210+
sort >expect_cookies.txt <<-\EOF &&
211211
212212
127.0.0.1 FALSE /smart_cookies/ FALSE 0 othername othervalue
213213
127.0.0.1 FALSE /smart_cookies/repo.git/info/ FALSE 0 name value
214214
EOF
215215
git config http.cookiefile cookies.txt &&
216216
git config http.savecookies true &&
217217
git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
218-
tail -3 cookies.txt >cookies_tail.txt &&
218+
tail -3 cookies.txt | sort >cookies_tail.txt &&
219219
test_cmp expect_cookies.txt cookies_tail.txt
220220
'
221221

0 commit comments

Comments
 (0)