1. 13 Jun, 2017 1 commit
  2. 07 Apr, 2017 1 commit
    • filter: only close filter if it's been initialized correctly · cf07db2f
      In the function `git_filter_list_stream_data`, we initialize, write and
      subesquently close the stream which should receive content processed by
      the filter. While we skip writing to the stream if its initialization
      failed, we still try to close it unconditionally -- even if the
      initialization failed, where the stream might not be set at all, leading
      us to segfault.
      
      Semantics in this code is not really clear. The function handling the
      same logic for files instead of data seems to do the right thing here in
      only closing the stream when initialization succeeded. When stepping
      back a bit, this is only reasonable: if a stream cannot be initialized,
      the caller would not expect it to be closed again. So actually, both
      callers of `stream_list_init` fail to do so. The data streaming function
      will always close the stream and the file streaming function will not
      close the stream if writing to it has failed.
      
      The fix is thus two-fold:
      
      - callers of `stream_list_init` now close the stream iff it has been
        initialized
      - `stream_list_init` now closes the lastly initialized stream if
        the current stream in the chain failed to initialize
      
      Add a test which segfaulted previous to these changes.
      Patrick Steinhardt committed
  3. 29 Dec, 2016 1 commit
  4. 09 Feb, 2016 1 commit
  5. 12 Jul, 2015 1 commit
  6. 01 Jul, 2015 1 commit
  7. 10 Jun, 2015 2 commits
  8. 11 May, 2015 1 commit
  9. 07 May, 2015 1 commit
  10. 28 Apr, 2015 1 commit
    • Fix some build warnings · 69f0032b
      In checkout.c and filter.c we were casting a sub struct
      to a parent struct which breaks the strict aliasing rules
      in C. However we can use .parent or .base to access the
      parent struct to avoid the build warnings.
      
      In remote.c the local variable error was not initialized
      or updated in some cases. For unintialized error a build
      warning will be generated. So always keep error variable
      up-to-date.
      Leo Yang committed
  11. 25 Mar, 2015 1 commit
  12. 06 Mar, 2015 2 commits
  13. 19 Feb, 2015 4 commits
  14. 18 Feb, 2015 2 commits
  15. 17 Feb, 2015 4 commits
  16. 13 Feb, 2015 2 commits
  17. 03 Feb, 2015 1 commit
    • attrcache: don't re-read attrs during checkout · 9f779aac
      During checkout, assume that the .gitattributes files aren't
      modified during the checkout.  Instead, create an "attribute session"
      during checkout.  Assume that attribute data read in the same
      checkout "session" hasn't been modified since the checkout started.
      (But allow subsequent checkouts to invalidate the cache.)
      
      Further, cache nonexistent git_attr_file data even when .gitattributes
      files are not found to prevent re-scanning for nonexistent files.
      Edward Thomson committed
  18. 09 Oct, 2014 1 commit
  19. 08 May, 2014 2 commits
  20. 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
  21. 25 Apr, 2014 1 commit
  22. 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
  23. 24 Sep, 2013 1 commit
  24. 17 Sep, 2013 6 commits
    • Bug fixes and cleanups · eefc32d5
      This contains a few bug fixes and some header and API cleanups.
      
      The main API change is that filters should now use GIT_PASSTHROUGH
      to indicate that they wish to skip processing a file instead of
      GIT_ENOTFOUND.
      
      The bug fixes include a possible out-of-range buffer access in
      the ident filter, a filter ordering problem I introduced into the
      custom filter tests on Windows, and a filter buf NUL termination
      issue that was coming up on Linux.
      Russell Belfer committed
    • Some tests with ident and crlf filters · 37f9e409
      Fixed the filter order to match core Git, too.
      
      This test demonstrates an interesting behavior of core Git (which
      is totally reasonable and which libgit2 matches, although mostly
      by coincidence).  If you use the ident filter and commit a file
      with a garbage ident in it, like '$Id: this is just garbage$' and
      then immediately do a 'git checkout-index' with the new file, Git
      will not consider the file out of date and will not overwrite the
      file with an updated $Id$.  Libgit2 has the same behavior.  If you
      remove the file and then do a checkout-index, it will be replaced
      with a filtered version that has injected the OID correctly.
      Russell Belfer committed
    • Fix win32 warnings · e399c7ee
      I wish MSVC understood that "const char **" is not a const ptr,
      but it a non-const pointer to an array of const ptrs.  Does that
      seem like too much to ask.
      Russell Belfer committed
    • Port tests from PR 1683 · b47349b8
      This ports over some of the tests from
          https://github.com/libgit2/libgit2/pull/1683
      by @yorah and @ethomson
      Russell Belfer committed
    • 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 ident filter · 4b11f25a
      This adds the ident filter (that knows how to replace $Id$) and
      tweaks the filter APIs and code so that git_filter_source objects
      actually have the updated OID of the object being filtered when
      it is a known value.
      Russell Belfer committed