git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amos King <amos.l.king@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 2/2] Created a faux remote to pass to http_init. This allows  http_push to authenticate http through a prompt.
Date: Wed, 18 Mar 2009 18:46:41 -0500	[thread overview]
Message-ID: <d8c371a80903181646o6caf5948o25d2037486629c91@mail.gmail.com> (raw)

This patch allows http_push to use http authentication via prompts.
You may notice that there is a remote struct that only contains the
url from the repo struct.  This struct is a temporary fix for a larger
issue, but gets http authentication via prompts out the door, and
keeps users from having to store passwords in plain text files.

Signed-off-by: Amos King <amos.l.king@gmail.com>
---
 http-push.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/http-push.c b/http-push.c
index 9ac2664..885378b 100644
--- a/http-push.c
+++ b/http-push.c
@@ -2195,7 +2195,14 @@ 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

                 reply	other threads:[~2009-03-18 23:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8c371a80903181646o6caf5948o25d2037486629c91@mail.gmail.com \
    --to=amos.l.king@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).