]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/lib-httpd: respect $HTTPD_PROTO in expect_askpass()
authorJeff King <peff@peff.net>
Thu, 23 Feb 2023 11:05:55 +0000 (06:05 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Feb 2023 21:01:15 +0000 (13:01 -0800)
When the HTTP tests are run with LIB_HTTPD_SSL in the environment, then
we access the test server as https://. This causes expect_askpass to
complain, because it tries to blindly match "http://" in the prompt
shown to the user. We can adjust this to use $HTTPD_PROTO, which is set
during the setup phase.

Note that this is enough for t5551 and t5559 to pass when run with
https, but there are similar problems in other scripts that will need to
be fixed before the whole suite can run with LIB_HTTPD_SSL.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd.sh

index 608949ea80b9a90cd00fcde239e7a39e21184f29..c8fd4fc713334d5487409ae389ea8a827b58c21d 100644 (file)
@@ -280,11 +280,11 @@ expect_askpass() {
                none)
                        ;;
                pass)
-                       echo "askpass: Password for 'http://$2@$dest': "
+                       echo "askpass: Password for '$HTTPD_PROTO://$2@$dest': "
                        ;;
                both)
-                       echo "askpass: Username for 'http://$dest': "
-                       echo "askpass: Password for 'http://$2@$dest': "
+                       echo "askpass: Username for '$HTTPD_PROTO://$dest': "
+                       echo "askpass: Password for '$HTTPD_PROTO://$2@$dest': "
                        ;;
                *)
                        false