{"thread":{"id":"18392","subject":"[PATCH 2/2] Created a faux remote to pass to http_init. This allows http_push to authenticate http through a prompt.","startedAt":"2009-03-18T23:46:41Z","lastAt":"2009-03-18T23:46:41Z","messageCount":1,"participants":["Amos King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"108462","messageId":"d8c371a80903181646o6caf5948o25d2037486629c91@mail.gmail.com","threadId":"18392","inReplyTo":null,"subject":"[PATCH 2/2] Created a faux remote to pass to http_init. This allows http_push to authenticate http through a prompt.","fromName":"Amos King","fromEmail":"amos.l.king@gmail.com","sentAt":"2009-03-18T23:46:41Z","receivedAt":"2009-03-18T23:46:41Z","isPatch":true,"sender":{"key":"amos.l.king@gmail.com","avatar":"https://gravatar.com/avatar/764a302e2d39acef19662089f068068e8ea0e4313091f66b3c855dfc57950e29?d=mp&s=160"},"body":"This patch allows http_push to use http authentication via prompts.\nYou may notice that there is a remote struct that only contains the\nurl from the repo struct.  This struct is a temporary fix for a larger\nissue, but gets http authentication via prompts out the door, and\nkeeps users from having to store passwords in plain text files.\n\nSigned-off-by: Amos King <amos.l.king@gmail.com>\n---\n http-push.c |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 9ac2664..885378b 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2195,7 +2195,14 @@ int main(int argc, char **argv)\n\n \tmemset(remote_dir_exists, -1, 256);\n\n-\thttp_init(NULL);\n+\t//This is a faked remote so that http_init can get the correct data for\n+\t//builidng out athorization.\n+\tstruct remote *remote;\n+\tremote = xcalloc(sizeof(*remote), 1);\n+\tALLOC_GROW(remote->url, remote->url_nr + 1, remote->url_alloc);\n+\tremote->url[remote->url_nr++] = repo->url;\n+\n+\thttp_init(remote);\n\n \tno_pragma_header = curl_slist_append(no_pragma_header, \"Pragma:\");\n\n-- \n1.6.2.GIT\n"}]}