summaryrefslogtreecommitdiff
path: root/imap-send.c
diff options
context:
space:
mode:
authorKyle J. McKay <mackyle@gmail.com>2015-03-07 21:13:55 -0800
committerJunio C Hamano <gitster@pobox.com>2015-03-10 15:19:05 -0700
commitdcd01ea187fc9a936b4083a85343989840afd7bd (patch)
tree99ae30b57b30f4f6966806557fdba53e38780837 /imap-send.c
parent230c09c06a7300870f3915c54eff7d9335850a4a (diff)
downloadgit-dcd01ea187fc9a936b4083a85343989840afd7bd.tar.gz
imap-send: use cURL automatically when NO_OPENSSL definedkm/imap-send-libcurl-options
If both USE_CURL_FOR_IMAP_SEND and NO_OPENSSL are defined do not force the user to add --curl to get a working git imap-send command. Instead automatically select --curl and warn and ignore the --no-curl option. And while we're in there, correct the warning message when --curl is requested but not supported. Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/imap-send.c b/imap-send.c
index d69887da5a..37ac4aa86a 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -34,8 +34,16 @@ typedef void *SSL;
#include "http.h"
#endif
+#if defined(USE_CURL_FOR_IMAP_SEND) && defined(NO_OPENSSL)
+/* only available option */
+#define USE_CURL_DEFAULT 1
+#else
+/* strictly opt in */
+#define USE_CURL_DEFAULT 0
+#endif
+
static int verbosity;
-static int use_curl; /* strictly opt in */
+static int use_curl = USE_CURL_DEFAULT;
static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] < <mbox>", NULL };
@@ -1504,9 +1512,14 @@ int main(int argc, char **argv)
#ifndef USE_CURL_FOR_IMAP_SEND
if (use_curl) {
- warning("--use-curl not supported in this build");
+ warning("--curl not supported in this build");
use_curl = 0;
}
+#elif defined(NO_OPENSSL)
+ if (!use_curl) {
+ warning("--no-curl not supported in this build");
+ use_curl = 1;
+ }
#endif
if (!server.port)