Re: [PATCH 2/2] Allow core.askpass to override SSH_ASKPASS.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2010, 17:28 UTC
- Message-ID
- <7v4oeghsms.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <201008271445.26098.k.franke@science-computing.de>
Knut Franke <k.franke@science-computing.de> writes:
Show 14 quoted lines
>> > diff --git a/connect.c b/connect.c
>> > index e296bfc..f97b84c 100644
>> > --- a/connect.c
>> > +++ b/connect.c
>> > @@ -627,9 +627,13 @@ char *git_getpass(const char *prompt)
>> > static struct strbuf buffer = STRBUF_INIT;
>> >
>> > askpass = getenv("GIT_ASKPASS");
>> > +
>>
>> Why?
>
> Considering the check for SSH_ASKPASS added below, I believe this improves
> legibilty since all of the "if (!askpass..." blocks are similar in intention.I think Erik is asking about the extra blank line. You could have achieved the same consistency by removing, no?
diff --git a/connect.c b/connect.c index e296bfc..f97b84c 100644 --- a/connect.c +++ b/connect.c @@ -627,9 +627,10 @@ char *git_getpass(const char *prompt) static struct strbuf buffer = STRBUF_INIT; askpass = getenv("GIT_ASKPASS"); if (!askpass) askpass = askpass_program; - + if (!askpass) + askpass = getenv("SSH_ASKPASS"); if (!askpass || !(*askpass)) return getpass(prompt);