1. 10 Apr, 2023 1 commit
  2. 14 Jul, 2022 1 commit
  3. 20 Jun, 2022 1 commit
  4. 15 Jun, 2022 1 commit
  5. 23 Feb, 2022 1 commit
  6. 17 Oct, 2021 1 commit
    • str: introduce `git_str` for internal, `git_buf` is external · f0e693b1
      libgit2 has two distinct requirements that were previously solved by
      `git_buf`.  We require:
      
      1. A general purpose string class that provides a number of utility APIs
         for manipulating data (eg, concatenating, truncating, etc).
      2. A structure that we can use to return strings to callers that they
         can take ownership of.
      
      By using a single class (`git_buf`) for both of these purposes, we have
      confused the API to the point that refactorings are difficult and
      reasoning about correctness is also difficult.
      
      Move the utility class `git_buf` to be called `git_str`: this represents
      its general purpose, as an internal string buffer class.  The name also
      is an homage to Junio Hamano ("gitstr").
      
      The public API remains `git_buf`, and has a much smaller footprint.  It
      is generally only used as an "out" param with strict requirements that
      follow the documentation.  (Exceptions exist for some legacy APIs to
      avoid breaking callers unnecessarily.)
      
      Utility functions exist to convert a user-specified `git_buf` to a
      `git_str` so that we can call internal functions, then converting it
      back again.
      Edward Thomson committed
  7. 10 Sep, 2021 1 commit
  8. 09 Sep, 2021 1 commit
  9. 27 Nov, 2020 1 commit
  10. 25 Nov, 2020 1 commit
  11. 07 Feb, 2020 1 commit
    • notes: check error code returned by `git_iterator_advance` · 31a577d0
      When calling `git_note_next`, we end up calling `git_iterator_advance`
      but ignore its error code. The intent is that we do not want to return
      an error if it returns `GIT_ITEROVER`, as we want to return that value
      on the next invocation of `git_note_next`. We should still check for any
      other error codes returned by `git_iterator_advance` to catch unexpected
      internal errors.
      
      Fix this by checking the function's return value, ignoring
      `GIT_ITEROVER`.
      Patrick Steinhardt committed
  12. 22 Nov, 2019 1 commit
  13. 15 Jun, 2019 1 commit
  14. 25 Jan, 2019 1 commit
  15. 22 Jan, 2019 1 commit
  16. 13 Jul, 2018 1 commit
    • treewide: remove use of C++ style comments · 9994cd3f
      C++ style comment ("//") are not specified by the ISO C90 standard and
      thus do not conform to it. While libgit2 aims to conform to C90, we did
      not enforce it until now, which is why quite a lot of these
      non-conforming comments have snuck into our codebase. Do a tree-wide
      conversion of all C++ style comments to the supported C style comments
      to allow us enforcing strict C90 compliance in a later commit.
      Patrick Steinhardt committed
  17. 10 Jun, 2018 1 commit
  18. 02 Dec, 2017 1 commit
  19. 06 Oct, 2017 4 commits
  20. 23 Sep, 2017 1 commit
  21. 29 Dec, 2016 1 commit
  22. 28 Aug, 2015 1 commit
  23. 17 Mar, 2015 1 commit
  24. 13 Feb, 2015 1 commit
  25. 27 Dec, 2014 1 commit
  26. 17 Dec, 2014 1 commit
  27. 06 Dec, 2014 1 commit
  28. 21 Nov, 2014 2 commits
  29. 27 Oct, 2014 1 commit
  30. 25 Jan, 2014 1 commit
  31. 24 Jan, 2014 1 commit
  32. 11 Dec, 2013 5 commits
    • Further callback error check style fixes · f10d7a36
      Okay, I've decided I like the readability of this style much
      better so I used it everywhere.
      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
    • 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