1. 02 Jun, 2015 1 commit
  2. 17 Sep, 2014 1 commit
  3. 11 Dec, 2013 2 commits
    • 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
    • Further EUSER and error propagation fixes · dab89f9b
      This continues auditing all the places where GIT_EUSER is being
      returned and making sure to clear any existing error using the
      new giterr_user_cancel helper.  As a result, places that relied
      on intercepting GIT_EUSER but having the old error preserved also
      needed to be cleaned up to correctly stash and then retrieve the
      actual error.
      
      Additionally, as I encountered places where error codes were not
      being propagated correctly, I tried to fix them up.  A number of
      those fixes are included in the this commit as well.
      Russell Belfer committed
  4. 14 Nov, 2013 1 commit
  5. 03 Oct, 2013 1 commit
    • Wrap iconv stuff and write tests · 618b7689
      This adds a simple wrapper around the iconv APIs and uses it
      instead of the old code that was inlining the iconv stuff.  This
      makes it possible for me to test the iconv logic in isolation.
      A "no iconv" version of the API was defined with macros so that
      I could have fewer ifdefs in the code itself.
      Russell Belfer committed
  6. 03 Sep, 2013 3 commits
  7. 11 Feb, 2013 1 commit
  8. 26 Dec, 2012 2 commits
  9. 11 Jul, 2012 1 commit
    • Add path utilities to resolve relative paths · b0fe1129
      This makes it easy to take a buffer containing a path with relative
      references (i.e. .. or . path segments) and resolve all of those
      into a clean path.  This can be applied to URLs as well as file
      paths which can be useful.
      
      As part of this, I made the drive-letter detection apply on all
      platforms, not just windows.  If you give a path that looks like
      "c:/..." on any platform, it seems like we might as well detect
      that as a rooted path.  I suppose if you create a directory named
      "x:" on another platform and want to use that as the beginning
      of a relative path under the root directory of your repo, this
      could cause a problem, but then it seems like you're asking for
      trouble.
      Russell Belfer committed
  10. 17 May, 2012 2 commits
  11. 08 May, 2012 1 commit
  12. 17 Apr, 2012 1 commit
  13. 16 Mar, 2012 2 commits
  14. 27 Feb, 2012 1 commit
    • buffer: Unify `git_fbuffer` and `git_buf` · 13224ea4
      This makes so much sense that I can't believe it hasn't been done
      before. Kill the old `git_fbuffer` and read files straight into
      `git_buf` objects.
      
      Also: In order to fully support 4GB files in 32-bit systems, the
      `git_buf` implementation has been changed from using `ssize_t` for
      storage and storing negative values on allocation failure, to using
      `size_t` and changing the buffer pointer to a magical pointer on
      allocation failure.
      
      Hopefully this won't break anything.
      Vicent Martí committed
  15. 25 Jan, 2012 1 commit
  16. 12 Jan, 2012 1 commit
  17. 11 Jan, 2012 1 commit
    • Initial implementation of gitignore support · df743c7d
      Adds support for .gitignore files to git_status_foreach() and
      git_status_file().  This includes refactoring the gitattributes
      code to share logic where possible.  The GIT_STATUS_IGNORED flag
      will now be passed in for files that are ignored (provided they
      are not already in the index or the head of repo).
      Russell Belfer committed
  18. 28 Dec, 2011 2 commits
  19. 14 Dec, 2011 1 commit
    • Allow git_buf_joinpath to accept self-joins · b5daae68
      It was not safe for git_buf_joinpath to be used with a pointer
      into the buf itself because a reallocation could invalidate
      the input parameter that pointed into the buffer.  This patch
      makes it safe to self join, at least for the leading input to
      the join, which is the common "append" case for self joins.
      
      Also added unit tests to explicitly cover this case.
      
      This should actually fix #511
      Russell Belfer committed
  20. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      This converts virtually all of the places that allocate GIT_PATH_MAX
      buffers on the stack for manipulating paths to use git_buf objects
      instead.  The patch is pretty careful not to touch the public API
      for libgit2, so there are a few places that still use GIT_PATH_MAX.
      
      This extends and changes some details of the git_buf implementation
      to add a couple of extra functions and to make error handling easier.
      
      This includes serious alterations to all the path.c functions, and
      several of the fileops.c ones, too.  Also, there are a number of new
      functions that parallel existing ones except that use a git_buf
      instead of a stack-based buffer (such as git_config_find_global_r
      that exists alongsize git_config_find_global).
      
      This also modifies the win32 version of p_realpath to allocate whatever
      buffer size is needed to accommodate the realpath instead of hardcoding
      a GIT_PATH_MAX limit, but that change needs to be tested still.
      Russell Belfer committed
  21. 29 Oct, 2011 1 commit
  22. 14 Sep, 2011 1 commit