Skip to content

Commit 5a9681f

Browse files
Clemens Buchachergitster
authored andcommitted
http auth fails with multiple curl handles
Create a repo with multiple loose objects in order to demonstrate http authentication breakage. Signed-off-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8dde3e commit 5a9681f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

t/t5550-http-fetch.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,22 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
1313
start_httpd
1414

1515
test_expect_success 'setup repository' '
16-
echo content >file &&
16+
echo content1 >file &&
1717
git add file &&
1818
git commit -m one
19+
echo content2 >file &&
20+
git add file &&
21+
git commit -m two
1922
'
2023

21-
test_expect_success 'create http-accessible bare repository' '
22-
mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
24+
test_expect_success 'create http-accessible bare repository with loose objects' '
25+
cp -a .git "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
2326
(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
24-
git --bare init &&
27+
git config core.bare true &&
28+
mkdir -p hooks &&
2529
echo "exec git update-server-info" >hooks/post-update &&
26-
chmod +x hooks/post-update
30+
chmod +x hooks/post-update &&
31+
hooks/post-update
2732
) &&
2833
git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
2934
git push public master:master
@@ -87,21 +92,21 @@ test_expect_success 'http auth can use user/pass in URL' '
8792
expect_askpass none
8893
'
8994

90-
test_expect_success 'http auth can use just user in URL' '
95+
test_expect_failure 'http auth can use just user in URL' '
9196
>askpass-query &&
9297
echo user@host >askpass-response &&
9398
git clone "$HTTPD_URL_USER/auth/repo.git" clone-auth-pass &&
9499
expect_askpass pass user@host
95100
'
96101

97-
test_expect_success 'http auth can request both user and pass' '
102+
test_expect_failure 'http auth can request both user and pass' '
98103
>askpass-query &&
99104
echo user@host >askpass-response &&
100105
git clone "$HTTPD_URL/auth/repo.git" clone-auth-both &&
101106
expect_askpass both user@host
102107
'
103108

104-
test_expect_success 'http auth respects credential helper config' '
109+
test_expect_failure 'http auth respects credential helper config' '
105110
test_config_global credential.helper "!f() {
106111
cat >/dev/null
107112
echo username=user@host
@@ -113,15 +118,15 @@ test_expect_success 'http auth respects credential helper config' '
113118
expect_askpass none
114119
'
115120

116-
test_expect_success 'http auth can get username from config' '
121+
test_expect_failure 'http auth can get username from config' '
117122
test_config_global "credential.$HTTPD_URL.username" user@host &&
118123
>askpass-query &&
119124
echo user@host >askpass-response &&
120125
git clone "$HTTPD_URL/auth/repo.git" clone-auth-user &&
121126
expect_askpass pass user@host
122127
'
123128

124-
test_expect_success 'configured username does not override URL' '
129+
test_expect_failure 'configured username does not override URL' '
125130
test_config_global "credential.$HTTPD_URL.username" wrong &&
126131
>askpass-query &&
127132
echo user@host >askpass-response &&

0 commit comments

Comments
 (0)