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 <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Clemens Buchacher committed
Apr 10, 2012 at 11:53 UTC
5a9681f46aa9e152f32e76d7ade9d4c11313f99a
1 file changed
+15
-10
t/t5550-http-fetch.sh
+15
-10
@@ -13,17 +13,22 @@ LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
13
start_httpd
14
15
test_expect_success 'setup repository' '
16
- echo content >file &&
16
+ echo content1 >file &&
17
git add file &&
18
git commit -m one
19
+ echo content2 >file &&
20
+ git add file &&
21
+ git commit -m two
22
'
23
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" &&
26
(cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
24
- git --bare init &&
27
+ git config core.bare true &&
28
+ mkdir -p hooks &&
29
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
32
) &&
33
git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
34
git push public master:master
@@ -87,21 +92,21 @@ test_expect_success 'http auth can use user/pass in URL' '
92
expect_askpass none
93
'
94
90
-test_expect_success 'http auth can use just user in URL' '
95
+test_expect_failure 'http auth can use just user in URL' '
96
>askpass-query &&
97
echo user@host >askpass-response &&
98
git clone "$HTTPD_URL_USER/auth/repo.git" clone-auth-pass &&
99
expect_askpass pass user@host
100
'
101
97
-test_expect_success 'http auth can request both user and pass' '
102
+test_expect_failure 'http auth can request both user and pass' '
103
>askpass-query &&
104
echo user@host >askpass-response &&
105
git clone "$HTTPD_URL/auth/repo.git" clone-auth-both &&
106
expect_askpass both user@host
107
'
108
104
-test_expect_success 'http auth respects credential helper config' '
109
+test_expect_failure 'http auth respects credential helper config' '
110
test_config_global credential.helper "!f() {
111
cat >/dev/null
112
echo username=user@host
@@ -113,7 +118,7 @@ test_expect_success 'http auth respects credential helper config' '
118
expect_askpass none
119
'
120
116
-test_expect_success 'http auth can get username from config' '
121
+test_expect_failure 'http auth can get username from config' '
122
test_config_global "credential.$HTTPD_URL.username" user@host &&
123
>askpass-query &&
124
echo user@host >askpass-response &&
@@ -121,7 +126,7 @@ test_expect_success 'http auth can get username from config' '
126
expect_askpass pass user@host
127
'
128
124
-test_expect_success 'configured username does not override URL' '
129
+test_expect_failure 'configured username does not override URL' '
130
test_config_global "credential.$HTTPD_URL.username" wrong &&
131
>askpass-query &&
132
echo user@host >askpass-response &&