1. 08 Jun, 2017 1 commit
    • settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION` · 6c23704d
      Initially, the setting has been solely used to enable the use of
      `fsync()` when creating objects. Since then, the use has been extended
      to also cover references and index files. As the option is not yet part
      of any release, we can still correct this by renaming the option to
      something more sensible, indicating not only correlation to objects.
      
      This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also
      move the variable from the object to repository source code.
      Patrick Steinhardt committed
  2. 28 Feb, 2017 2 commits
  3. 29 Dec, 2016 1 commit
  4. 11 Mar, 2016 1 commit
    • object: avoid call of memset with ouf of bounds pointer · 61d7328d
      When computing a short OID we do this by first copying the
      leading parts into the new OID structure and then setting the
      trailing part to zero. In the case of the desired length being
      `GIT_OID_HEXSZ - 1` we will call `memset` with an out of bounds
      pointer and a length of 0. While this seems to cause no problems
      for common platforms the C89 standard does not explicitly state
      that calling `memset` with an out of bounds pointer and
      length of 0 is valid.
      
      Fix the potential issue by using the newly introduced
      `git_oid__cpy_prefix` function.
      Patrick Steinhardt committed
  5. 28 Feb, 2016 3 commits
  6. 30 Nov, 2015 1 commit
  7. 26 Jun, 2015 1 commit
    • Revert "object: correct the expected ID size in prefix lookup" · 3d9ef2dc
      This reverts commit 969d4b70.
      
      This was a fluke from Coverity. The length to all the APIs in the
      library is supposed to be passed in as nibbles, not bytes. Passing it as
      bytes would prevent us from parsing uneven-sized SHA1 strings.
      
      Also, the rest of the library was still using nibbles (including
      revparse and the odb_prefix APIs), so this change was seriously breaking
      things in unexpected ways. ^^
      Vicent Marti committed
  8. 10 Jun, 2015 1 commit
    • object: correct the expected ID size in prefix lookup · 969d4b70
      We take in a possibly partial ID by taking a length and working off of
      that to figure out whether to just look up the object or ask the
      backends for a prefix lookup.
      
      Unfortunately we've been checking the size against `GIT_OID_HEXSZ` which
      is the size of a *string* containing a full ID, whereas we need to check
      against the size we can have when it's a 20-byte array.
      
      Change the checks and comment to use `GIT_OID_RAWSZ` which is the
      correct size of a git_oid to have when full.
      Carlos Martín Nieto committed
  9. 22 Nov, 2014 1 commit
    • peel: reject bad queries with EINVALIDSPEC · 753e17b0
      There are some combination of objects and target types which we know
      cannot be fulfilled. Return EINVALIDSPEC for those to signify that there
      is a mismatch in the user-provided data and what the object model is
      capable of satisfying.
      
      If we start at a tag and in the course of peeling find out that we
      cannot reach a particular type, we return EPEEL.
      Carlos Martín Nieto committed
  10. 06 May, 2014 1 commit
  11. 05 Mar, 2014 1 commit
  12. 25 Feb, 2014 1 commit
  13. 28 Oct, 2013 1 commit
  14. 16 Sep, 2013 1 commit
  15. 11 May, 2013 1 commit
  16. 02 May, 2013 1 commit
  17. 01 May, 2013 1 commit
  18. 22 Apr, 2013 6 commits
  19. 10 Apr, 2013 1 commit
  20. 08 Jan, 2013 1 commit
  21. 01 Dec, 2012 1 commit
  22. 29 Nov, 2012 1 commit
  23. 28 Nov, 2012 2 commits
  24. 27 Nov, 2012 1 commit
  25. 22 Nov, 2012 1 commit
  26. 10 Sep, 2012 1 commit
    • Reorg internal odb read header and object lookup · c6ac28fd
      Often `git_odb_read_header` will "fail" and have to read the
      entire object into memory instead of just the header.  When this
      happens, the object is loaded and then disposed of immediately,
      which makes it difficult to efficiently use the header information
      to decide if the object should be loaded (since attempting to do
      so will often result in loading the object twice).
      
      This commit takes the existing code and reorganizes it to have
      two new functions:
      
      - `git_odb__read_header_or_object` which acts just like the old
        read header function except that it returns the object, too, if
        it was forced to load the whole thing.  It then becomes the
        callers responsibility to free the `git_odb_object`.
      - `git_object__from_odb_object` which was extracted from the old
        `git_object_lookup` and creates a subclass of `git_object` from
        an existing `git_odb_object` (separating the ODB lookup from the
        `git_object` creation).  This allows you to use the first header
        reading function efficiently without instantiating the
        `git_odb_object` twice.
      
      There is no net change to the behavior of any of the existing
      functions, but this allows internal code to tap into the ODB
      lookup and object creation to be more efficient.
      Russell Belfer committed
  27. 27 Aug, 2012 1 commit
    • Make git_object_peel a bit smarter · d8057a5b
      This expands the types of peeling that `git_object_peel` knows
      how to do to include TAG -> BLOB peeling, and makes the errors
      slightly more consistent depending on the situation.  It also
      adds a new special behavior where peeling to ANY will peel until
      the object type changes (e.g. chases TAGs to a non-TAG).
      
      Using this expanded peeling, this replaces peeling code that was
      embedded in `git_tag_peel` and `git_reset`.
      Russell Belfer committed
  28. 24 Jul, 2012 1 commit
  29. 17 Jul, 2012 1 commit
  30. 21 Jun, 2012 1 commit
  31. 17 May, 2012 1 commit