Add a new option 'core.askpass'.

Setting this option has the same effect as setting the environment variable
'GIT_ASKPASS'.

Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Anselm Kruis
2010-08-30 15:38:38 +02:00
committed by Junio C Hamano
parent 64fdc08dac
commit d3e7da8979
5 changed files with 14 additions and 1 deletions

View File

@ -621,12 +621,14 @@ int finish_connect(struct child_process *conn)
char *git_getpass(const char *prompt)
{
char *askpass;
const char *askpass;
struct child_process pass;
const char *args[3];
static struct strbuf buffer = STRBUF_INIT;
askpass = getenv("GIT_ASKPASS");
if (!askpass)
askpass = askpass_program;
if (!askpass || !(*askpass))
return getpass(prompt);