From: Junio C Hamano Date: Fri, 27 Aug 2010 17:28:43 GMT Subject: Re: [PATCH 2/2] Allow core.askpass to override SSH_ASKPASS. Message-ID: <7v4oeghsms.fsf@alter.siamese.dyndns.org> In-Reply-To: <201008271445.26098.k.franke@science-computing.de> Knut Franke writes: >> > 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);