Merge branch 'ab/sun-studio-portability'
[gitweb.git] / t / t5550-http-fetch.sh
index c59908fe77fdf1af3357a801e8ad86e3b0355508..95a133d697204a3b5dc469d188939198727e183a 100755 (executable)
@@ -53,7 +53,7 @@ test_expect_success 'setup askpass helpers' '
 '
 
 expect_askpass() {
-       dest=$HTTPD_DEST/auth/repo.git
+       dest=$HTTPD_DEST
        {
                case "$1" in
                none)
@@ -113,6 +113,22 @@ test_expect_success 'http auth respects credential helper config' '
        expect_askpass none
 '
 
+test_expect_success 'http auth can get username from config' '
+       test_config_global "credential.$HTTPD_URL.username" user@host &&
+       >askpass-query &&
+       echo user@host >askpass-response &&
+       git clone "$HTTPD_URL/auth/repo.git" clone-auth-user &&
+       expect_askpass pass user@host
+'
+
+test_expect_success 'configured username does not override URL' '
+       test_config_global "credential.$HTTPD_URL.username" wrong &&
+       >askpass-query &&
+       echo user@host >askpass-response &&
+       git clone "$HTTPD_URL_USER/auth/repo.git" clone-auth-user2 &&
+       expect_askpass pass user@host
+'
+
 test_expect_success 'fetch changes via http' '
        echo content >>file &&
        git commit -a -m two &&