1. 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
  2. 02 May, 2014 4 commits
  3. 23 Apr, 2014 2 commits
    • Treat ignored, empty, and untracked dirs different · 219c89d1
      In the iterator, distinguish between ignores and empty directories
      so that diff and status can ignore empty directories, but checkout
      and stash can treat them as untracked items.
      Russell Belfer committed
    • Make checkout match diff for untracked/ignored dir · 37da3685
      When diff finds an untracked directory, it emulates Git behavior
      by looking inside the directory to see if there are any untracked
      items inside it. If there are only ignored items inside the dir,
      then diff considers it ignored, even if there is no direct ignore
      rule for it.
      
      Checkout was not copying this behavior - when it found an untracked
      directory, it just treated it as untracked.  Unfortunately, when
      combined with GIT_CHECKOUT_REMOVE_UNTRACKED, this made is seem that
      checkout (and stash, which uses checkout) was removing ignored
      items when you had only asked it to remove untracked ones.
      
      This commit moves the logic for advancing past an untracked dir
      while scanning for non-ignored items into an iterator helper fn,
      and uses that for both diff and checkout.
      Russell Belfer committed
  4. 22 Apr, 2014 1 commit
    • Make stash and checkout ignore contained repos · 24d17de2
      To emulate git, stash should not remove untracked git repositories
      inside the parent repo, and checkout's REMOVE_UNTRACKED should
      also skip over these items.
      
      `git stash` actually prints a warning message for these items.
      That should be possible with a checkout notify callback if you
      wanted to, although it would require a bit of extra logic as things
      are at the moment.
      Russell Belfer committed
  5. 17 Apr, 2014 3 commits
  6. 02 Apr, 2014 1 commit
  7. 25 Mar, 2014 2 commits
    • Fix submodule leaks and invalid references · 591e8295
      This cleans up some places I missed that could hold onto submodule
      references and cleans up the way in which the repository cache is
      both reloaded and released so that existing submodule references
      aren't destroyed inappropriately.
      Russell Belfer committed
    • Make submodules externally refcounted · a15c7802
      `git_submodule` objects were already refcounted internally in case
      the submodule name was different from the path at which it was
      stored.  This makes that refcounting externally used as well, so
      `git_submodule_lookup` and `git_submodule_add_setup` return an
      object that requires a `git_submodule_free` when done.
      Russell Belfer committed
  8. 20 Mar, 2014 1 commit
  9. 06 Mar, 2014 2 commits
  10. 30 Jan, 2014 2 commits
    • Fix checkout NONE to not remove file · 25babd02
      If you are checking out NONE, then don't remove.
      Russell Belfer committed
    • Force explicit remove of files instead of defer · 71ae7601
      The checkout code used to defer removal of "blocking" files in
      checkouts until the blocked item was actually being written (since
      we have already checked that the removing the block is acceptable
      according to the update rules).  Unfortunately, this resulted in
      an intermediate index state where both the blocking and new items
      were in the index which is no longer allowed.  Now we just remove
      the blocking item in the first pass so it never needs to coexist.
      
      In cases where there are typechanges, this could result in a bit
      more churn of removing and recreating intermediate directories,
      but I'm going to assume that is an unusual case and the churn will
      not be too costly.
      Russell Belfer committed
  11. 25 Jan, 2014 2 commits
  12. 22 Jan, 2014 2 commits
  13. 20 Jan, 2014 5 commits
  14. 13 Dec, 2013 2 commits
  15. 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
  16. 11 Dec, 2013 5 commits
    • Fix checkout notify callback docs and tests · cbd04896
      The checkout notify callback behavior on non-zero return values
      was not being tested.  This adds tests, fixes a bug with positive
      values, and clarifies the documentation to make it clear that the
      checkout can be canceled via this mechanism.
      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
    • Add git_vector_free_all · fcd324c6
      There are a lot of places that we call git__free on each item in
      a vector and then call git_vector_free on the vector itself.  This
      just wraps that up into one convenient helper function.
      Russell Belfer committed
    • Improve GIT_EUSER handling · 96869a4e
      This adds giterr_user_cancel to return GIT_EUSER and clear any
      error message that is sitting around.  As a result of using that
      in places, we need to be more thorough with capturing errors that
      happen inside a callback when used internally.  To help with that,
      this also adds giterr_capture and giterr_restore so that when we
      internally use a foreach-type function that clears errors and
      converts them to GIT_EUSER, it is easier to restore not just the
      return value, but the actual error message text.
      Russell Belfer committed
  17. 05 Nov, 2013 1 commit
  18. 02 Nov, 2013 3 commits