Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH v4 3/4] imap_send: setup_curl: retreive credentials if not set in config file
Date: Fri, 15 Sep 2017 13:50:25 +0900	[thread overview]
Message-ID: <xmqqshfoy38u.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <accffa40-3559-5f65-3149-aaa86a2278fc@morey-chaisemartin.com> (Nicolas Morey-Chaisemartin's message of "Thu, 14 Sep 2017 09:52:06 +0200")

Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> writes:

>  
> +	if (cred.username)
> +		if (res == CURLE_OK)
> +			credential_approve(&cred);
> +#if LIBCURL_VERSION_NUM >= 0x070d01
> +		else if (res == CURLE_LOGIN_DENIED)
> +#else
> +		else
> +#endif
> +			credential_reject(&cred);
> +
> +	credential_clear(&cred);
> +

As my copy of GCC seemed to be worried about readers getting
confused by the if/else cascade, I'd place an extra pair of braces
around this, i.e.

	if (cred.username) {
		if (res == CURLE_OK)
			credential_approve(&cred);
		else /* or "else if DENIED" */
			credential_reject(&cred);
	}
	credential_clear(&cred);

while queuing this patch.


  parent reply	other threads:[~2017-09-15  4:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14  7:50 [PATCH v4 0/4] imap-send: Fix and enable curl by default Nicolas Morey-Chaisemartin
2017-09-14  7:51 ` [PATCH v4 1/4] imap-send: return with error if curl failed Nicolas Morey-Chaisemartin
2017-09-14  7:52 ` [PATCH v4 2/4] imap-send: add wrapper to get server credentials if needed Nicolas Morey-Chaisemartin
2017-09-14  7:52 ` [PATCH v4 3/4] imap_send: setup_curl: retreive credentials if not set in config file Nicolas Morey-Chaisemartin
2017-09-15  4:44   ` Junio C Hamano
2017-09-15  4:50   ` Junio C Hamano [this message]
2017-09-14  7:52 ` [PATCH v4 4/4] imap-send: use curl by default when possible Nicolas Morey-Chaisemartin

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=xmqqshfoy38u.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nicolas@morey-chaisemartin.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