Merge branch 'lv/tls-1.3'
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 04:09:57 +0000 (13:09 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 04:09:57 +0000 (13:09 +0900)
When built with more recent cURL, GIT_SSL_VERSION can now specify
"tlsv1.3" as its value.

* lv/tls-1.3:
http: allow use of TLS 1.3

1  2 
Documentation/config.txt
http.c
diff --combined Documentation/config.txt
index 4e0cff87f62f5d5c320e3dcea03f646416604bca,ca8d1687ccb0b1b6b681fc57b7d7c67cae582d67..2659153cb377554bc5cf6fc4199233b2bab498a2
@@@ -1398,16 -1398,7 +1398,16 @@@ fetch.unpackLimit:
  
  fetch.prune::
        If true, fetch will automatically behave as if the `--prune`
 -      option was given on the command line.  See also `remote.<name>.prune`.
 +      option was given on the command line.  See also `remote.<name>.prune`
 +      and the PRUNING section of linkgit:git-fetch[1].
 +
 +fetch.pruneTags::
 +      If true, fetch will automatically behave as if the
 +      `refs/tags/*:refs/tags/*` refspec was provided when pruning,
 +      if not set already. This allows for setting both this option
 +      and `fetch.prune` to maintain a 1=1 mapping to upstream
 +      refs. See also `remote.<name>.pruneTags` and the PRUNING
 +      section of linkgit:git-fetch[1].
  
  fetch.output::
        Control how ref update status is printed. Valid values are
@@@ -1957,6 -1948,7 +1957,7 @@@ http.sslVersion:
        - tlsv1.0
        - tlsv1.1
        - tlsv1.2
+       - tlsv1.3
  
  +
  Can be overridden by the `GIT_SSL_VERSION` environment variable.
@@@ -2954,15 -2946,6 +2955,15 @@@ remote.<name>.prune:
        remote (as if the `--prune` option was given on the command line).
        Overrides `fetch.prune` settings, if any.
  
 +remote.<name>.pruneTags::
 +      When set to true, fetching from this remote by default will also
 +      remove any local tags that no longer exist on the remote if pruning
 +      is activated in general via `remote.<name>.prune`, `fetch.prune` or
 +      `--prune`. Overrides `fetch.pruneTags` settings, if any.
 ++
 +See also `remote.<name>.prune` and the PRUNING section of
 +linkgit:git-fetch[1].
 +
  remotes.<group>::
        The list of remotes which are fetched by "git remote update
        <group>".  See linkgit:git-remote[1].
@@@ -3228,8 -3211,7 +3229,8 @@@ submodule.active:
  
  submodule.recurse::
        Specifies if commands recurse into submodules by default. This
 -      applies to all commands that have a `--recurse-submodules` option.
 +      applies to all commands that have a `--recurse-submodules` option,
 +      except `clone`.
        Defaults to false.
  
  submodule.fetchJobs::
@@@ -3362,10 -3344,6 +3363,10 @@@ uploadpack.packObjectsHook:
        was run. I.e., `upload-pack` will feed input intended for
        `pack-objects` to the hook, and expects a completed packfile on
        stdout.
 +
 +uploadpack.allowFilter::
 +      If this option is set, `upload-pack` will support partial
 +      clone and partial fetch object filtering.
  +
  Note that this configuration variable is ignored if it is seen in the
  repository-level config (this is a safety measure against fetching from
diff --combined http.c
index 833321a34072efa469782577ff3993f9915e847f,4699cf76c94a7b82a74cb12448bef0b61973af86..3034d10b6804387bc267b27757e2eae2279415d5
--- 1/http.c
--- 2/http.c
+++ b/http.c
@@@ -14,7 -14,6 +14,7 @@@
  #include "packfile.h"
  #include "protocol.h"
  #include "string-list.h"
 +#include "object-store.h"
  
  static struct trace_key trace_curl = TRACE_KEY_INIT(CURL);
  static int trace_curl_data = 1;
@@@ -63,6 -62,9 +63,9 @@@ static struct 
        { "tlsv1.1", CURL_SSLVERSION_TLSv1_1 },
        { "tlsv1.2", CURL_SSLVERSION_TLSv1_2 },
  #endif
+ #if LIBCURL_VERSION_NUM >= 0x073400
+       { "tlsv1.3", CURL_SSLVERSION_TLSv1_3 },
+ #endif
  };
  #if LIBCURL_VERSION_NUM >= 0x070903
  static const char *ssl_key;
@@@ -70,9 -72,6 +73,9 @@@
  #if LIBCURL_VERSION_NUM >= 0x070908
  static const char *ssl_capath;
  #endif
 +#if LIBCURL_VERSION_NUM >= 0x071304
 +static const char *curl_no_proxy;
 +#endif
  #if LIBCURL_VERSION_NUM >= 0x072c00
  static const char *ssl_pinnedkey;
  #endif
@@@ -81,6 -80,7 +84,6 @@@ static long curl_low_speed_limit = -1
  static long curl_low_speed_time = -1;
  static int curl_ftp_no_epsv;
  static const char *curl_http_proxy;
 -static const char *curl_no_proxy;
  static const char *http_proxy_authmethod;
  static struct {
        const char *name;
@@@ -1263,14 -1263,14 +1266,14 @@@ static struct fill_chain *fill_cfg
  
  void add_fill_function(void *data, int (*fill)(void *))
  {
 -      struct fill_chain *new = xmalloc(sizeof(*new));
 +      struct fill_chain *new_fill = xmalloc(sizeof(*new_fill));
        struct fill_chain **linkp = &fill_cfg;
 -      new->data = data;
 -      new->fill = fill;
 -      new->next = NULL;
 +      new_fill->data = data;
 +      new_fill->fill = fill;
 +      new_fill->next = NULL;
        while (*linkp)
                linkp = &(*linkp)->next;
 -      *linkp = new;
 +      *linkp = new_fill;
  }
  
  void fill_active_slots(void)
@@@ -2136,7 -2136,7 +2139,7 @@@ int finish_http_pack_request(struct htt
                return -1;
        }
  
 -      install_packed_git(p);
 +      install_packed_git(the_repository, p);
        free(tmp_idx);
        return 0;
  }
@@@ -2237,7 -2237,7 +2240,7 @@@ struct http_object_request *new_http_ob
        unsigned char *sha1)
  {
        char *hex = sha1_to_hex(sha1);
 -      const char *filename;
 +      struct strbuf filename = STRBUF_INIT;
        char prevfile[PATH_MAX];
        int prevlocal;
        char prev_buf[PREV_BUF_SIZE];
        hashcpy(freq->sha1, sha1);
        freq->localfile = -1;
  
 -      filename = sha1_file_name(sha1);
 +      sha1_file_name(the_repository, &filename, sha1);
        snprintf(freq->tmpfile, sizeof(freq->tmpfile),
 -               "%s.temp", filename);
 +               "%s.temp", filename.buf);
  
 -      snprintf(prevfile, sizeof(prevfile), "%s.prev", filename);
 +      snprintf(prevfile, sizeof(prevfile), "%s.prev", filename.buf);
        unlink_or_warn(prevfile);
        rename(freq->tmpfile, prevfile);
        unlink_or_warn(freq->tmpfile);
 +      strbuf_release(&filename);
  
        if (freq->localfile != -1)
                error("fd leakage in start: %d", freq->localfile);
@@@ -2372,7 -2371,6 +2375,7 @@@ void process_http_object_request(struc
  int finish_http_object_request(struct http_object_request *freq)
  {
        struct stat st;
 +      struct strbuf filename = STRBUF_INIT;
  
        close(freq->localfile);
        freq->localfile = -1;
                unlink_or_warn(freq->tmpfile);
                return -1;
        }
 -      freq->rename =
 -              finalize_object_file(freq->tmpfile, sha1_file_name(freq->sha1));
 +      sha1_file_name(the_repository, &filename, freq->sha1);
 +      freq->rename = finalize_object_file(freq->tmpfile, filename.buf);
 +      strbuf_release(&filename);
  
        return freq->rename;
  }