1. 31 3月, 2009 3 次提交
  2. 30 3月, 2009 2 次提交
  3. 25 3月, 2009 2 次提交
    • L
      close_sha1_file(): make it easier to diagnose errors · e8bd78c3
      Linus Torvalds 提交于
      A bug report with "unable to write sha1 file" made us realize that we do
      not have enough information to guess why close() is failing.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e8bd78c3
    • N
      avoid possible overflow in delta size filtering computation · 720fe22d
      Nicolas Pitre 提交于
      On a 32-bit system, the maximum possible size for an object is less than
      4GB, while 64-bit systems may cope with larger objects.  Due to this
      limitation, variables holding object sizes are using an unsigned long
      type (32 bits on 32-bit systems, or 64 bits on 64-bit systems).
      
      When large objects are encountered, and/or people play with large delta
      depth values, it is possible for the maximum allowed delta size
      computation to overflow, especially on a 32-bit system.  When this
      occurs, surviving result bits may represent a value much smaller than
      what it is supposed to be, or even zero.  This prevents some objects
      from being deltified although they do get deltified when a smaller depth
      limit is used.  Fix this by always performing a 64-bit multiplication.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      720fe22d
  4. 23 3月, 2009 1 次提交
  5. 13 3月, 2009 4 次提交
  6. 01 3月, 2009 1 次提交
  7. 28 2月, 2009 1 次提交
  8. 27 2月, 2009 1 次提交
    • C
      bisect: fix quoting TRIED revs when "bad" commit is also "skip"ped · 1b249ffe
      Christian Couder 提交于
      When the "bad" commit was also "skip"ped and when more than one
      commit was skipped, the "filter_skipped" function would have
      printed something like:
      
          bisect_rev=<hash1>|<hash2>
      
      (where <hash1> and <hash2> are hexadecimal sha1 hashes)
      
      and this would have been evaled later as piping "bisect_rev=<hash1>"
      into "<hash2>", which would have failed.
      
      So this patch makes the "filter_skipped" function properly quote
      what it outputs, so that it will print something like:
      
      bisect_rev='<hash1>|<hash2>'
      
      which will be properly evaled later.  The caller was not stopping
      properly because the scriptlet this function returned to be evaled
      was not strung together with && and because of this, an error in
      an earlier part of the output was simply ignored.
      
      A test case is added to the test suite.
      
      And while at it, we also initialize the VARS, FOUND and TRIED
      variables, so that we protect ourselves from environment variables
      the user may have with these names.
      Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1b249ffe
  9. 13 2月, 2009 1 次提交
    • F
      Support "\" in non-wildcard exclusion entries · dd482eea
      Finn Arne Gangstad 提交于
      "\" was treated differently in exclude rules depending on whether a
      wildcard match was done. For wildcard rules, "\" was de-escaped in
      fnmatch, but this was not done for other rules since they used strcmp
      instead.  A file named "#foo" would not be excluded by "\#foo", but would
      be excluded by "\#foo*".
      
      We now treat all rules with "\" as wildcard rules.
      
      Another solution could be to de-escape all non-wildcard rules as we
      read them, but we would have to do the de-escaping exactly as fnmatch
      does it to avoid inconsistencies.
      Signed-off-by: NFinn Arne Gangstad <finnag@pvv.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dd482eea
  10. 12 2月, 2009 3 次提交
    • J
      Make repack less likely to corrupt repository · 3e6b1d0a
      Junio C Hamano 提交于
      Some platforms refuse to rename a file that is open.  When repacking an
      already packed repository without adding any new object, the resulting
      pack will contain the same set of objects as an existing pack, and on such
      platforms, a newly created packfile cannot replace the existing one.
      
      The logic detected this issue but did not try hard enough to recover from
      it.  Especially because the files that needs renaming come in pairs, there
      potentially are different failure modes that one can be renamed but the
      others cannot.  Asking manual recovery to end users were error prone.
      
      This patch tries to make it more robust by first making sure all the
      existing files that need to be renamed have been renamed before
      continuing, and attempts to roll back if some failed to rename.
      
      This is based on an initial patch by Robin Rosenberg.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3e6b1d0a
    • E
      fast-export: ensure we traverse commits in topological order · 784f8aff
      Elijah Newren 提交于
      fast-export will only list as parents those commits which have already
      been traversed (making it appear as if merges have been squashed if not
      all parents have been traversed).  To avoid this silent squashing of
      merge commits, we request commits in topological order.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Acked-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      784f8aff
    • S
      Clear the delta base cache if a pack is rebuilt · fa3a0c94
      Shawn O. Pearce 提交于
      There is some risk that re-opening a regenerated pack file with
      different offsets could leave stale entries within the delta base
      cache that could be matched up against other objects using the same
      "struct packed_git*" and pack offset.
      
      Throwing away the entire delta base cache in this case is safer,
      as we don't have to worry about a recycled "struct packed_git*"
      matching to the wrong base object, resulting in delta apply
      errors while unpacking an object.
      Suggested-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fa3a0c94
  11. 11 2月, 2009 1 次提交
  12. 05 2月, 2009 4 次提交
  13. 04 2月, 2009 4 次提交
  14. 03 2月, 2009 1 次提交
  15. 01 2月, 2009 1 次提交
    • R
      merge: fix out-of-bounds memory access · c7cddc1a
      René Scharfe 提交于
      The parameter n of unpack_callback() can have a value of up to
      MAX_UNPACK_TREES.  The check at the top of unpack_trees() (its only
      (indirect) caller) makes sure it cannot exceed this limit.
      
      unpack_callback() passes it and the array src to unpack_nondirectories(),
      which has this loop:
      
      	for (i = 0; i < n; i++) {
      		/* ... */
      		src[i + o->merge] = o->df_conflict_entry;
      
      o->merge can be 0 or 1, so unpack_nondirectories() potentially accesses
      the array src at index MAX_UNPACK_TREES.  This patch makes it big enough.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NRené Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7cddc1a
  16. 29 1月, 2009 3 次提交
  17. 28 1月, 2009 2 次提交
  18. 27 1月, 2009 1 次提交
    • J
      diff.c: output correct index lines for a split diff · b67b9612
      Junio C Hamano 提交于
      A patch that changes the filetype (e.g. regular file to symlink) of a path
      must be split into a deletion event followed by a creation event, which
      means that we need to have two independent metainfo lines for each.
      However, the code reused the single set of metainfo lines.
      
      As the blob object names recorded on the index lines are usually not used
      nor validated on the receiving end, this is not an issue with normal use
      of the resulting patch.  However, when accepting a binary patch to delete
      a blob, git-apply verified that the postimage blob object name on the
      index line is 0{40}, hence a patch that deletes a regular file blob that
      records binary contents to create a blob with different filetype (e.g. a
      symbolic link) failed to apply.  "git am -3" also uses the blob object
      names recorded on the index line, so it would also misbehave when
      synthesizing a preimage tree.
      
      This moves the code to generate metainfo lines around, so that two
      independent sets of metainfo lines are used for the split halves.
      
      Additional tests by Jeff King.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b67b9612
  19. 23 1月, 2009 1 次提交
  20. 18 1月, 2009 3 次提交