[PATCH 2/2] Allow http authentication via prompt for http push.
- From
Amos King <amos.l.king@gmail.com>
- Date
- Mar 19, 2009, 15:12 UTC
- Message-ID
- <d8c371a80903190812w59febbd3qc6bc3d70ce85f76e@mail.gmail.com>
There is now a faux remote created in order to be passed to http_init.
Signed-off-by: Amos King <amos.l.king@gmail.com> --- http-push.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/http-push.c b/http-push.c index 9ac2664..468d5af 100644 --- a/http-push.c +++ b/http-push.c @@ -2195,7 +2195,16 @@ int main(int argc, char **argv) memset(remote_dir_exists, -1, 256); - http_init(NULL); + /* + * This is a faked remote so that http_init can + * get the correct data for builidng out athorization. + */ + struct remote *remote; + remote = xcalloc(sizeof(*remote), 1); + ALLOC_GROW(remote->url, remote->url_nr + 1, remote->url_alloc); + remote->url[remote->url_nr++] = repo->url; + + http_init(remote); no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
-- 1.6.2.GIT