1. 25 Jan, 2019 1 commit
  2. 22 Jan, 2019 1 commit
  3. 10 Jun, 2018 2 commits
  4. 19 Mar, 2018 1 commit
  5. 08 Jun, 2017 3 commits
    • buffer: return errors for `git_buf_init` and `git_buf_attach` · 4796c916
      Both the `git_buf_init` and `git_buf_attach` functions may call
      `git_buf_grow` in case they were given an allocation length as
      parameter. As such, it is possible for these functions to fail when we
      run out of memory. While it won't probably be used anytime soon, it does
      indeed make sense to also record this fact by returning an error code
      from both functions. As they belong to the internal API only, this
      change does not break our interface.
      Patrick Steinhardt committed
    • buffer: consistently use `ENSURE_SIZE` to grow buffers on-demand · 9a8386a2
      The `ENSURE_SIZE` macro can be used to grow a buffer if its currently
      allocated size does not suffice a required target size. While most of
      the code already uses this macro, the `git_buf_join` and `git_buf_join3`
      functions do not yet use it. Due to the macro first checking whether we
      have to grow the buffer at all, this has the benefit of saving a
      function call when it is not needed. While this is nice to have, it will
      probably not matter at all performance-wise -- instead, this only serves
      for consistency across the code.
      Patrick Steinhardt committed
    • buffer: fix `ENSURE_SIZE` macro referencing wrong variable · e82dd813
      While the `ENSURE_SIZE` macro gets a reference to both the buffer that
      is to be resized and a new size, we were not consistently referencing
      the passed buffer, but instead a variable `buf`, which is not passed in.
      Funnily enough, we never noticed because our buffers seem to always be
      named `buf` whenever the macro was being used.
      
      Fix the macro by always using the passed-in buffer. While at it, add
      braces around all mentions of passed-in variables as should be done with
      macros to avoid subtle errors.
      
      Found-by: Edward Thompson
      Patrick Steinhardt committed
  6. 29 Dec, 2016 1 commit
  7. 26 May, 2016 4 commits
  8. 24 Jun, 2015 2 commits
  9. 19 Feb, 2015 1 commit
  10. 13 Feb, 2015 4 commits
  11. 09 Jan, 2015 1 commit
  12. 21 Nov, 2014 1 commit
  13. 15 Aug, 2014 1 commit
  14. 16 Jul, 2014 1 commit
  15. 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
  16. 23 Apr, 2014 1 commit
  17. 10 Apr, 2014 1 commit
  18. 01 Apr, 2014 1 commit
  19. 25 Feb, 2014 1 commit
  20. 20 Jan, 2014 1 commit
  21. 08 Jan, 2014 1 commit
  22. 24 Sep, 2013 1 commit
  23. 19 Sep, 2013 1 commit
  24. 17 Sep, 2013 4 commits
    • Merge git_buf and git_buffer · a9f51e43
      This makes the git_buf struct that was used internally into an
      externally available structure and eliminates the git_buffer.
      
      As part of that, some of the special cases that arose with the
      externally used git_buffer were blended into the git_buf, such as
      being careful about git_buf objects that may have a NULL ptr and
      allowing for bufs with a valid ptr and size but zero asize as a
      way of referring to externally owned data.
      Russell Belfer committed
    • Add functions to manipulate filter lists · 40cb40fa
      Extend the git2/sys/filter API with functions to look up a filter
      and add it manually to a filter list.  This requires some trickery
      because the regular attribute lookups and checks are bypassed when
      this happens, but in the right hands, it will allow a user to have
      granular control over applying filters.
      Russell Belfer committed
    • Extend public filter api with filter lists · 2a7d224f
      This moves the git_filter_list into the public API so that users
      can create, apply, and dispose of filter lists.  This allows more
      granular application of filters to user data outside of libgit2
      internals.
      
      This also converts all the internal usage of filters to the public
      APIs along with a few small tweaks to make it easier to use the
      public git_buffer stuff alongside the internal git_buf.
      Russell Belfer committed
    • Start of filter API + git_blob_filtered_content · 0cf77103
      This begins the process of exposing git_filter objects to the
      public API.  This includes:
      
      * new public type and API for `git_buffer` through which an
        allocated buffer can be passed to the user
      * new API `git_blob_filtered_content`
      * make the git_filter type and GIT_FILTER_TO_... constants public
      Russell Belfer committed
  25. 01 Jul, 2013 1 commit
  26. 08 Jan, 2013 1 commit
  27. 28 Nov, 2012 1 commit
    • Consolidate text buffer functions · 7bf87ab6
      There are many scattered functions that look into the contents of
      buffers to do various text manipulations (such as escaping or
      unescaping data, calculating text stats, guessing if content is
      binary, etc).  This groups all those functions together into a
      new file and converts the code to use that.
      
      This has two enhancements to existing functionality.  The old
      text stats function is significantly rewritten and the BOM
      detection code was extended (although largely we can't deal with
      anything other than a UTF8 BOM).
      Russell Belfer committed