1. 22 Feb, 2019 1 commit
  2. 15 Feb, 2019 3 commits
    • oidmap: introduce high-level setter for key/value pairs · 2e0a3048
      Currently, one would use either `git_oidmap_insert` to insert key/value pairs
      into a map or `git_oidmap_put` to insert a key only. These function have
      historically been macros, which is why their syntax is kind of weird: instead of
      returning an error code directly, they instead have to be passed a pointer to
      where the return value shall be stored. This does not match libgit2's common
      idiom of directly returning error codes.Furthermore, `git_oidmap_put` is tightly
      coupled with implementation details of the map as it exposes the index of
      inserted entries.
      
      Introduce a new function `git_oidmap_set`, which takes as parameters the map,
      key and value and directly returns an error code. Convert all trivial callers of
      `git_oidmap_insert` and `git_oidmap_put` to make use of it.
      Patrick Steinhardt committed
    • oidmap: introduce high-level getter for values · 9694ef20
      The current way of looking up an entry from a map is tightly coupled with the
      map implementation, as one first has to look up the index of the key and then
      retrieve the associated value by using the index. As a caller, you usually do
      not care about any indices at all, though, so this is more complicated than
      really necessary. Furthermore, it invites for errors to happen if the correct
      error checking sequence is not being followed.
      
      Introduce a new high-level function `git_oidmap_get` that takes a map and a key
      and returns a pointer to the associated value if such a key exists. Otherwise,
      a `NULL` pointer is returned. Adjust all callers that can trivially be
      converted.
      Patrick Steinhardt committed
    • maps: use uniform lifecycle management functions · 351eeff3
      Currently, the lifecycle functions for maps (allocation, deallocation, resize)
      are not named in a uniform way and do not have a uniform function signature.
      Rename the functions to fix that, and stick to libgit2's naming scheme of saying
      `git_foo_new`. This results in the following new interface for allocation:
      
      - `int git_<t>map_new(git_<t>map **out)` to allocate a new map, returning an
        error code if we ran out of memory
      
      - `void git_<t>map_free(git_<t>map *map)` to free a map
      
      - `void git_<t>map_clear(git<t>map *map)` to remove all entries from a map
      
      This commit also fixes all existing callers.
      Patrick Steinhardt committed
  3. 22 Jan, 2019 1 commit
  4. 01 Dec, 2018 1 commit
  5. 28 Nov, 2018 1 commit
  6. 01 Oct, 2018 1 commit
  7. 22 Jun, 2018 2 commits
  8. 10 Jun, 2018 1 commit
  9. 02 Mar, 2017 1 commit
  10. 17 Feb, 2017 9 commits
  11. 13 Jan, 2017 1 commit
  12. 29 Dec, 2016 1 commit
  13. 20 Dec, 2016 1 commit
  14. 24 Jul, 2016 1 commit
  15. 20 Jun, 2016 1 commit
  16. 26 May, 2016 3 commits
  17. 11 Mar, 2016 1 commit
  18. 23 Feb, 2016 2 commits
  19. 09 Feb, 2016 2 commits
  20. 28 Oct, 2015 1 commit
  21. 31 Jul, 2015 1 commit
  22. 13 May, 2015 1 commit
  23. 17 Mar, 2015 1 commit
  24. 11 Mar, 2015 2 commits
    • pack-objects: fill a packbuilder from a walk · 04a36fef
      Most use-cases for the object packer communicate in terms of commits
      which each side has. We already have an object to specify this
      relationship between commits, namely git_revwalk.
      
      By knowing which commits we want to pack and which the other side
      already has, we can perform similar optimisations to git, by marking
      each tree as interesting or uninteresting only once, and not sending
      those trees which we know the other side has.
      Carlos Martín Nieto committed
    • Reorder some khash declarations · b63b76e0
      Keep the definitions in the headers, while putting the declarations in
      the C files. Putting the function definitions in headers causes
      them to be duplicated if you include two headers with them.
      Carlos Martín Nieto committed