1. 04 Jan, 2015 1 commit
  2. 27 Dec, 2014 1 commit
  3. 17 Dec, 2014 1 commit
  4. 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
  5. 16 Sep, 2014 1 commit
  6. 18 Aug, 2014 1 commit
  7. 01 Jul, 2014 1 commit
  8. 10 Jun, 2014 1 commit
    • treebuilder: use a map instead of vector to store the entries · 4d3f1f97
      Finding a filename in a vector means we need to resort it every time we
      want to read from it, which includes every time we want to write to it
      as well, as we want to find duplicate keys.
      
      A hash-map fits what we want to do much more accurately, as we do not
      care about sorting, but just the particular filename.
      
      We still keep removed entries around, as the interface let you assume
      they were going to be around until the treebuilder is cleared or freed,
      but in this case that involves an append to a vector in the filter case,
      which can now fail.
      
      The only time we care about sorting is when we write out the tree, so
      let's make that the only time we do any sorting.
      Carlos Martín Nieto committed
  9. 07 Jun, 2014 1 commit
  10. 18 May, 2014 1 commit
  11. 08 May, 2014 1 commit
    • Be more careful with user-supplied buffers · 1e4976cb
      This adds in missing calls to `git_buf_sanitize` and fixes a
      number of places where `git_buf` APIs could inadvertently write
      NUL terminator bytes into invalid buffers.  This also changes the
      behavior of `git_buf_sanitize` to NUL terminate a buffer if it can
      and of `git_buf_shorten` to do nothing if it can.
      
      Adds tests of filtering code with zeroed (i.e. unsanitized) buffer
      which was previously triggering a segfault.
      Russell Belfer committed
  12. 06 May, 2014 1 commit
    • Add filter options and ALLOW_UNSAFE · 5269008c
      Diff and status do not want core.safecrlf to actually raise an
      error regardless of the setting, so this extends the filter API
      with an additional options flags parameter and adds a flag so that
      filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating
      that unsafe filter application should be downgraded from a failure
      to a warning.
      Russell Belfer committed
  13. 29 Apr, 2014 1 commit
    • commit: safer commit creation with reference update · 217c029b
      The current version of the commit creation and amend function are unsafe
      to use when passing the update_ref parameter, as they do not check that
      the reference at the moment of update points to what the user expects.
      
      Make sure that we're moving history forward when we ask the library to
      update the reference for us by checking that the first parent of the new
      commit is the current value of the reference. We also make sure that the
      ref we're updating hasn't moved between the read and the write.
      
      Similarly, when amending a commit, make sure that the current tip of the
      branch is the commit we're amending.
      Carlos Martín Nieto committed
  14. 10 Mar, 2014 1 commit
  15. 05 Mar, 2014 1 commit
  16. 08 Feb, 2014 1 commit
    • Add git_commit_amend API · 80c29fe9
      This adds an API to amend an existing commit, basically a shorthand
      for creating a new commit filling in missing parameters from the
      values of an existing commit.  As part of this, I also added a new
      "sys" API to create a commit using a callback to get the parents.
      This allowed me to rewrite all the other commit creation APIs so
      that temporary allocations are no longer needed.
      Russell Belfer committed
  17. 27 Jan, 2014 1 commit
  18. 25 Jan, 2014 1 commit
  19. 03 Jan, 2014 2 commits
  20. 12 Dec, 2013 1 commit
  21. 11 Dec, 2013 2 commits
    • Update git_blob_create_fromchunks callback behavr · 19853bdd
      The callback to supply data chunks could return a negative value
      to stop creation of the blob, but we were neither using GIT_EUSER
      nor propagating the return value.  This makes things use the new
      behavior of returning the negative value back to the user.
      Russell Belfer committed
    • Remove converting user error to GIT_EUSER · 25e0b157
      This changes the behavior of callbacks so that the callback error
      code is not converted into GIT_EUSER and instead we propagate the
      return value through to the caller.  Instead of using the
      giterr_capture and giterr_restore functions, we now rely on all
      functions to pass back the return value from a callback.
      
      To avoid having a return value with no error message, the user
      can call the public giterr_set_str or some such function to set
      an error message.  There is a new helper 'giterr_set_callback'
      that functions can invoke after making a callback which ensures
      that some error message was set in case the callback did not set
      one.
      
      In places where the sign of the callback return value is
      meaningful (e.g. positive to skip, negative to abort), only the
      negative values are returned back to the caller, obviously, since
      the other values allow for continuing the loop.
      
      The hardest parts of this were in the checkout code where positive
      return values were overloaded as meaningful values for checkout.
      I fixed this by adding an output parameter to many of the internal
      checkout functions and removing the overload.  This added some
      code, but it is probably a better implementation.
      
      There is some funkiness in the network code where user provided
      callbacks could be returning a positive or a negative value and
      we want to rely on that to cancel the loop.  There are still a
      couple places where an user error might get turned into GIT_EUSER
      there, I think, though none exercised by the tests.
      Russell Belfer committed
  22. 14 Nov, 2013 1 commit