1. 28 7月, 2015 5 次提交
  2. 16 7月, 2015 12 次提交
  3. 09 7月, 2015 2 次提交
    • J
      check_and_freshen_file: fix reversed success-check · 3096b2ec
      Jeff King 提交于
      When we want to write out a loose object file, we have
      always first made sure we don't already have the object
      somewhere. Since 33d4221c (write_sha1_file: freshen existing
      objects, 2014-10-15), we also update the timestamp on the
      file, so that a simultaneous prune knows somebody is
      likely to reference it soon.
      
      If our utime() call fails, we treat this the same as not
      having the object in the first place; the safe thing to do
      is write out another copy. However, the loose-object check
      accidentally inverts the utime() check; it returns failure
      _only_ when the utime() call actually succeeded. Thus it was
      failing to protect us there, and in the normal case where
      utime() succeeds, it caused us to pointlessly write out and
      link the object.
      
      This passed our freshening tests, because writing out the
      new object is certainly _one_ way of updating its utime. So
      the normal case was inefficient, but not wrong.
      
      While we're here, let's also drop a comment in front of the
      check_and_freshen functions, making a note of their return
      type (since it is not our usual "0 for success, -1 for
      error").
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3096b2ec
    • C
      rebase: return non-zero error code if format-patch fails · 60d708b2
      Clemens Buchacher 提交于
      Since e481af06 (rebase: Handle cases where format-patch fails) we
      notice if format-patch fails and return immediately from
      git-rebase--am. We save the return value with ret=$?, but then we
      return $?, which is usually zero in this case.
      
      Fix this by returning $ret instead.
      
      Cc: Andrew Wong <andrew.kw.w@gmail.com>
      Signed-off-by: NClemens Buchacher <clemens.buchacher@intel.com>
      Helped-by: NJorge Nunes <jorge.nunes@intel.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      60d708b2
  4. 02 7月, 2015 1 次提交
    • J
      rev-list: disable --use-bitmap-index when pruning commits · c8a70d35
      Jeff King 提交于
      The reachability bitmaps do not have enough information to
      tell us which commits might have changed path "foo", so the
      current code produces wrong answers for:
      
        git rev-list --use-bitmap-index --count HEAD -- foo
      
      (it silently ignores the "foo" limiter). Instead, we should
      fall back to doing a normal traversal (it is OK to fall
      back rather than complain, because --use-bitmap-index is a
      pure optimization, and might not kick in for other reasons,
      such as there being no bitmaps in the repository).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c8a70d35
  5. 26 6月, 2015 12 次提交
  6. 25 6月, 2015 1 次提交
    • C
      Fix definition of ARRAY_SIZE for non-gcc builds · e2c6f7cd
      Charles Bailey 提交于
      The improved ARRAY_SIZE macro uses BARF_UNLESS_AN_ARRAY which expands
      to a valid check for recent gcc versions and to 0 for older gcc
      versions but is not defined on non-gcc builds.
      
      Non-gcc builds need this macro to expand to 0 as well. The current outer
      test (defined(__GNUC__) && (__GNUC__ >= 3)) is a strictly weaker
      condition than the inner test (GIT_GNUC_PREREQ(3, 1)) so we can omit the
      outer test and cause the BARF_UNLESS_AN_ARRAY macro to be defined
      correctly on non-gcc builds as well as gcc builds with older versions.
      Signed-off-by: NCharles Bailey <cbailey32@bloomberg.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e2c6f7cd
  7. 18 6月, 2015 3 次提交
    • R
      test-lib.sh: fix color support when tput needs ~/.terminfo · d5c1b7c2
      Richard Hansen 提交于
      If tput needs ~/.terminfo for the current $TERM, then tput will
      succeed before HOME is changed to $TRASH_DIRECTORY (causing color to
      be set to 't') but fail afterward.
      
      One possible way to fix this is to treat HOME like TERM: back up the
      original value and temporarily restore it before say_color() runs
      tput.
      
      Instead, pre-compute and save the color control sequences before
      changing either TERM or HOME.  Use the saved control sequences in
      say_color() rather than call tput each time.  This avoids the need to
      back up and restore the TERM and HOME variables, and it avoids the
      overhead of a subshell and two invocations of tput per call to
      say_color().
      Signed-off-by: NRichard Hansen <rhansen@bbn.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d5c1b7c2
    • R
      Revert "test-lib.sh: do tests for color support after changing HOME" · ca92a660
      Richard Hansen 提交于
      This reverts commit 102fc80d.
      
      There are two issues with that commit:
      
        * It is buggy.  In pseudocode, it is doing:
      
             color is set || TERM != dumb && color works && color=t
      
          when it should be doing:
      
             color is set || { TERM != dumb && color works && color=t }
      
        * It unnecessarily disables color when tput needs to read
          ~/.terminfo to get the control sequences.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ca92a660
    • M
      fetch-pack: check for shallow if depth given · eb86a507
      Mike Edgar 提交于
      When a repository is first fetched as a shallow clone, either by
      git-clone or by fetching into an empty repo, the server's capabilities
      are not currently consulted. The client will send shallow requests even
      if the server does not understand them, and the resulting error may be
      unhelpful to the user. This change pre-emptively checks so we can exit
      with a helpful error if necessary.
      Signed-off-by: NMike Edgar <adgar@google.com>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      eb86a507
  8. 17 6月, 2015 4 次提交