1. May 28, 2016
  2. May 25, 2016
  3. May 24, 2016
  4. May 19, 2016
  5. May 17, 2016
    • Carlos Martín Nieto's avatar
      Introduce a function to create a tree based on a different one · 9464f9eb
      Carlos Martín Nieto authored
      Instead of going through the usual steps of reading a tree recursively
      into an index, modifying it and writing it back out as a tree, introduce
      a function to perform simple updates more efficiently.
      
      `git_tree_create_updated` avoids reading trees which are not modified
      and supports upsert and delete operations. It is not as versatile as
      modifying the index, but it makes some common operations much more
      efficient.
      9464f9eb
  6. May 09, 2016
  7. May 07, 2016
  8. May 06, 2016
  9. May 05, 2016
  10. May 04, 2016
  11. May 03, 2016
  12. May 02, 2016
    • Patrick Steinhardt's avatar
      delta-apply: fix sign extension · 153fde5b
      Patrick Steinhardt authored
      We compute offsets by executing `off |= (*delta++ << 24)` for
      multiple constants, where `off` is of type `size_t` and `delta`
      is of type `unsigned char`. The usual arithmetic conversions (see
      ISO C89 §3.2.1.5 "Usual arithmetic conversions") kick in here,
      causing us to promote both operands to `int` and then extending
      the result to an `unsigned long` when OR'ing it with `off`.
      The integer promotion to `int` may result in wrong size
      calculations for big values.
      
      Fix the issue by making the constants `unsigned long`, causing both
      operands to be promoted to `unsigned long`.
      153fde5b
    • Patrick Steinhardt's avatar
      odb_loose: fix undefined behavior when computing size · 7f407710
      Patrick Steinhardt authored
      An object's size is computed by reading the object header's size
      field until the most significant bit is not set anymore. To get
      the total size, we increase the shift on each iteration and add
      the shifted value to the total size.
      
      We read the current value into a variable of type `unsigned
      char`, from which we then take all bits except the most
      significant bit and shift the result. We will end up with a
      maximum shift of 60, but this exceeds the width of the value's
      type, resulting in undefined behavior.
      
      Fix the issue by instead reading the values into a variable of
      type `unsigned long`, which matches the required width. This is
      equivalent to git.git, which uses an `unsigned long` as well.
      7f407710
    • Patrick Steinhardt's avatar
      checkout: set ignorecase=0 when config lookup fails · 7b24c4fd
      Patrick Steinhardt authored
      When `git_repository__cvar` fails we may end up with a
      `ignorecase` value of `-1`. As we subsequently check if
      `ignorecase` is non-zero, we may end up reporting that data
      should be removed when in fact it should not.
      
      Err on the safer side and set `ignorecase = 0` when
      `git_repository__cvar` fails.
      7b24c4fd
    • Patrick Steinhardt's avatar
      merge_file: do not unnecessarily check ours/theirs for NULL · fcd1b786
      Patrick Steinhardt authored
      The `merge_file__xdiff` function checks if either `ours` or
      `theirs` is `NULL`. The function is to be called with existing
      files, though, and in fact already unconditionally dereferences
      both pointers.
      
      Remove the unnecessary check to silence warnings.
      fcd1b786
    • Carlos Martín Nieto's avatar
      odb: avoid inflating the full delta to read the header · a97b769a
      Carlos Martín Nieto authored
      When we read the header, we want to know the size and type of the
      object. We're currently inflating the full delta in order to read the
      first few bytes. This can mean hundreds of kB needlessly inflated for
      large objects.
      
      Instead use a packfile stream to read just enough so we can read the two
      varints in the header and avoid inflating most of the delta.
      a97b769a
    • Patrick Steinhardt's avatar
      index: fix memory leak on error case · f80852af
      Patrick Steinhardt authored
      f80852af
  13. Apr 30, 2016
  14. Apr 29, 2016
  15. Apr 27, 2016
  16. Apr 26, 2016