1. 10 Sep, 2014 1 commit
    • ssh: store error message immediately after a failed agent call · c93d1eba
      When the call to the agent fails, we must retrieve the error message
      just after the function call, as other calls may overwrite it.
      
      As the agent authentication is the only one which has a teardown and
      there does not seem to be a way to get the error message from a stored
      error number, this tries to introduce some small changes to store the
      error from the agent.
      
      Clearing the error at the beginning of the loop lets us know whether the
      agent has already set the libgit2 error message and we should skip it,
      or if we should set it.
      Carlos Martín Nieto committed
  2. 18 Aug, 2014 1 commit
    • http: make sure we can consume the data we request · 7d729d0b
      The recv buffer (parse_buffer) and the buffer have independent sizes and
      offsets. We try to fill in parse_buffer as much as possible before
      passing it to the http parser. This is fine most of the time, but fails
      us when the buffer is almost full.
      
      In those situations, parse_buffer can have more data than we would be
      able to put into the buffer (which may be getting full if we're towards
      the end of a data sideband packet).
      
      To work around this, we check if the space we have left on our buffer is
      smaller than what could come from the network. If this happens, we make
      parse_buffer think that it has as much space left as our buffer, so it
      won't try to retrieve more data than we can deal with.
      
      As the start of the data may no longer be at the start of the buffer, we
      need to keep track of where it really starts (data_offset) and use that
      in our calculations for the real size of the data we received from the
      network.
      
      This fixes #2518.
      Carlos Martín Nieto committed
  3. 05 Aug, 2014 2 commits
  4. 13 Jun, 2014 1 commit
  5. 03 Jun, 2014 1 commit
  6. 22 May, 2014 2 commits
  7. 21 May, 2014 3 commits
  8. 20 May, 2014 1 commit
  9. 22 Apr, 2014 1 commit
  10. 21 Apr, 2014 4 commits
  11. 20 Apr, 2014 2 commits
  12. 18 Apr, 2014 4 commits
  13. 18 Mar, 2014 1 commit
  14. 07 Mar, 2014 1 commit
  15. 25 Feb, 2014 1 commit
  16. 19 Jan, 2014 1 commit
  17. 17 Jan, 2014 1 commit
  18. 15 Jan, 2014 1 commit
  19. 12 Dec, 2013 1 commit
    • Cleanups, renames, and leak fixes · 9cfce273
      This renames git_vector_free_all to the better git_vector_free_deep
      and also contains a couple of memory leak fixes based on valgrind
      checks.  The fixes are specifically: failure to free global dir
      path variables when not compiled with threading on and failure to
      free filters from the filter registry that had not be initialized
      fully.
      Russell Belfer committed
  20. 11 Dec, 2013 3 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
    • Add config read fns with controlled error behavior · 9f77b3f6
      This adds `git_config__lookup_entry` which will look up a key in
      a config and return either the entry or NULL if the key was not
      present.  Optionally, it can either suppress all errors or can
      return them (although not finding the key is not an error for this
      function).  Unlike other accessors, this does not normalize the
      config key string, so it must only be used when the key is known
      to be in normalized form (i.e. all lower-case before the first dot
      and after the last dot, with no invalid characters).
      
      This also adds three high-level helper functions to look up config
      values with no errors and a fallback value.  The three functions
      are for string, bool, and int values, and will resort to the
      fallback value for any error that arises.  They are:
      
      * `git_config__get_string_force`
      * `git_config__get_bool_force`
      * `git_config__get_int_force`
      
      None of them normalize the config `key` either, so they can only
      be used for internal cases where the key is known to be in normal
      format.
      Russell Belfer committed
  21. 03 Dec, 2013 1 commit
  22. 20 Nov, 2013 1 commit
  23. 18 Nov, 2013 2 commits
  24. 11 Nov, 2013 2 commits
  25. 05 Nov, 2013 1 commit