1. 16 10月, 2017 8 次提交
  2. 11 10月, 2017 13 次提交
  3. 10 10月, 2017 4 次提交
    • J
      write_entry: untangle symlink and regular-file cases · 7cbbf9d6
      Jeff King 提交于
      The write_entry() function switches on the mode of the entry
      we're going to write out. The cases for S_IFLNK and S_IFREG
      are lumped together. In earlier versions of the code, this
      made some sense. They have a shared preamble (which reads
      the blob content), a short type-specific body, and a shared
      conclusion (which writes out the file contents; always for
      S_IFREG and only sometimes for S_IFLNK).
      
      But over time this has grown to make less sense. The preamble
      now has conditional bits for each type, and the S_IFREG body
      has grown a lot more complicated. It's hard to follow the
      logic of which code is running for which mode.
      
      Let's give each mode its own case arm. We will still share
      the conclusion code, which means we now jump to it with a
      goto. Ideally we'd pull that shared code into its own
      function, but it touches so much internal state in the
      write_entry() function that the end result is actually
      harder to follow than the goto.
      
      While we're here, we'll touch up a few bits of whitespace to
      make the beginning and endings of the cases easier to read.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7cbbf9d6
    • J
      write_entry: avoid reading blobs in CE_RETRY case · c602d3a9
      Jeff King 提交于
      When retrying a delayed filter-process request, we don't
      need to send the blob to the filter a second time. However,
      we read it unconditionally into a buffer, only to later
      throw away that buffer. We can make this more efficient by
      skipping the read in the first place when it isn't
      necessary.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c602d3a9
    • J
      write_entry: fix leak when retrying delayed filter · b2401586
      Jeff King 提交于
      When write_entry() retries a delayed filter request, we
      don't need to send the blob content to the filter again, and
      set the pointer to NULL. But doing so means we leak the
      contents we read earlier from read_blob_entry(). Let's make
      sure to free it before dropping the pointer.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2401586
    • D
      cleanup: fix possible overflow errors in binary search · 19716b21
      Derrick Stolee 提交于
      A common mistake when writing binary search is to allow possible
      integer overflow by using the simple average:
      
      	mid = (min + max) / 2;
      
      Instead, use the overflow-safe version:
      
      	mid = min + (max - min) / 2;
      
      This translation is safe since the operation occurs inside a loop
      conditioned on "min < max". The included changes were found using
      the following git grep:
      
      	git grep '/ *2;' '*.c'
      
      Making this cleanup will prevent future review friction when a new
      binary search is contructed based on existing code.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      19716b21
  4. 09 10月, 2017 2 次提交
  5. 07 10月, 2017 13 次提交
    • J
      Prepare for -rc1 · d35688db
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d35688db
    • J
      Merge branch 'tb/ref-filter-empty-modifier' · 43c9e7e3
      Junio C Hamano 提交于
      In the "--format=..." option of the "git for-each-ref" command (and
      its friends, i.e. the listing mode of "git branch/tag"), "%(atom:)"
      (e.g. "%(refname:)", "%(body:)" used to error out.  Instead, treat
      them as if the colon and an empty string that follows it were not
      there.
      
      * tb/ref-filter-empty-modifier:
        ref-filter.c: pass empty-string as NULL to atom parsers
      43c9e7e3
    • J
      Merge branch 'ks/verify-filename-non-option-error-message-tweak' · 2a5aa826
      Junio C Hamano 提交于
      Error message tweak.
      
      * ks/verify-filename-non-option-error-message-tweak:
        setup: update error message to be more meaningful
      2a5aa826
    • J
      Merge branch 'ks/branch-tweak-error-message-for-extra-args' · 932b5734
      Junio C Hamano 提交于
      Error message tweak.
      
      * ks/branch-tweak-error-message-for-extra-args:
        branch: change the error messages to be more meaningful
      932b5734
    • J
      Merge branch 'jk/ui-color-always-to-auto' · da15b78e
      Junio C Hamano 提交于
      Fix regression of "git add -p" for users with "color.ui = always"
      in their configuration, by merging the topic below and adjusting it
      for the 'master' front.
      
      * jk/ui-color-always-to-auto:
        t7301: use test_terminal to check color
        t4015: use --color with --color-moved
        color: make "always" the same as "auto" in config
        provide --color option for all ref-filter users
        t3205: use --color instead of color.branch=always
        t3203: drop "always" color test
        t6006: drop "always" color config tests
        t7502: use diff.noprefix for --verbose test
        t7508: use test_terminal for color output
        t3701: use test-terminal to collect color output
        t4015: prefer --color to -c color.diff=always
        test-terminal: set TERM=vt100
      da15b78e
    • J
      Merge branch 'ma/builtin-unleak' · 5261fefa
      Junio C Hamano 提交于
      Many variables that points at a region of memory that will live
      throughout the life of the program have been marked with UNLEAK
      marker to help the leak checkers concentrate on real leaks..
      
      * ma/builtin-unleak:
        builtin/: add UNLEAKs
      5261fefa
    • J
      Merge branch 'rb/compat-poll-fix' · 1f57e71f
      Junio C Hamano 提交于
      Backports a moral equivalent of 2015 fix to the poll emulation from
      the upstream gnulib to fix occasional breakages on HPE NonStop.
      
      * rb/compat-poll-fix:
        poll.c: always set revents, even if to zero
      1f57e71f
    • J
      Merge branch 'tg/memfixes' · 98c03a0d
      Junio C Hamano 提交于
      Fixes for a handful memory access issues identified by valgrind.
      
      * tg/memfixes:
        sub-process: use child_process.args instead of child_process.argv
        http-push: fix construction of hex value from path
        path.c: fix uninitialized memory access
      98c03a0d
    • J
      Merge branch 'sb/branch-avoid-repeated-strbuf-release' · cfa0fd0f
      Junio C Hamano 提交于
      * sb/branch-avoid-repeated-strbuf-release:
        branch: reset instead of release a strbuf
      cfa0fd0f
    • J
      Merge branch 'rs/qsort-s' · bd40f41b
      Junio C Hamano 提交于
      * rs/qsort-s:
        test-stringlist: avoid buffer underrun when sorting nothing
      bd40f41b
    • J
      Merge branch 'jn/strbuf-doc-re-reuse' · aae4788e
      Junio C Hamano 提交于
      * jn/strbuf-doc-re-reuse:
        strbuf doc: reuse after strbuf_release is fine
      aae4788e
    • J
      Merge branch 'tb/delimit-pretty-trailers-args-with-comma' · 436b3594
      Junio C Hamano 提交于
      The feature that allows --pretty='%(trailers)' to take modifiers
      like "fold" and "only" used to separate these modifiers with a
      comma, i.e. "%(trailers:fold:only)", but we changed our mind and
      use a comma, i.e. "%(trailers:fold,only)".  Fast track this change
      before this new feature becomes part of any official release.
      
      * tb/delimit-pretty-trailers-args-with-comma:
        pretty.c: delimit "%(trailers)" arguments with ","
      436b3594
    • T
      completion: add --broken and --dirty to describe · 78236550
      Thomas Braun 提交于
      When the flags for broken and dirty were implemented in
      b0176ce6 (builtin/describe: introduce --broken flag, 2017-03-21)
      and 9f67d2e8 (Teach "git describe" --dirty option, 2009-10-21)
      the completion was not updated, although these flags are useful
      completions. Add them.
      Signed-off-by: NThomas Braun <thomas.braun@virtuell-zuhause.de>
      Helped-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      78236550