Re: [PATCH] http-push: don't always prompt for password
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 4, 2011, 19:06 UTC
- Message-ID
- <7vwrbfbtbq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20111104174303.GA22568@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> Since we now only call init_curl_http_auth when we know we need auth, I
> think it would make more sense to just move the user_name asking there,
> too, like:
>
> static void init_curl_http_auth(CURL *result)
> {
> struct strbuf up = STRBUF_INIT;
>
> if (!user_name)
> user_name = xstrdup(git_getpass_with_description("Username", description);
> if (!user_pass)
> user_pass = xstrdup(git_getpass_with_description("Password", description);
>
> strbuf_addf(&up, "%s:%s", user_name, user_pass);
> curl_easy_setopt(result, CURLOPT_USERPWD, strbuf_detach(&up, NULL));
> }
>
> And then it's easy to swap out the asking for credential_fill() when it
> becomes available. But I admit I don't care that much now, as I'll just
> end up doing that refactoring later with my credential patches anyway.Yeah, let's not over-churn this part for now as we know it will change anyway.
Thanks both!