1. 20 Jan, 2017 1 commit
    • Allow for caching of submodules. · 4d99c4cf
      Added `git_repository_submodule_cache_all` to initialze a cache of
      submodules on the repository so that operations looking up N
      submodules are O(N) and not O(N^2).  Added a
      `git_repository_submodule_cache_clear` function to remove the cache.
      
      Also optimized the function that loads all submodules as it was itself
      O(N^2) w.r.t the number of submodules, having to loop through the
      `.gitmodules` file once per submodule.  I changed it to process the
      `.gitmodules` file once, into a map.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      Brock Peabody committed
  2. 22 Jun, 2015 2 commits
    • submodule: handle writing out all enum values for settings · c4e3a3db
      We currently do not handle those enum values which require us to set
      "true" or unset variables in all cases. Use a common function which does
      understand this by looking at our mapping directly.
      Carlos Martín Nieto committed
    • submodule: remove the per-repo cache · dfda2f68
      Having this cache and giving them out goes against our multithreading
      guarantees and it makes it impossible to use submodules in a
      multi-threaded environment, as any thread can ask for a refresh which
      may reallocate some string in the submodule struct which we've accessed
      in a different one via a getter.
      
      This makes the submodules behave more like remotes, where each object is
      created upon request and not shared except explicitly by the user. This
      means that some tests won't pass yet, as they assume they can affect the
      submodule objects in the cache and that will affect later operations.
      Carlos Martín Nieto committed
  3. 20 Jun, 2015 1 commit
  4. 01 Apr, 2014 2 commits
  5. 31 Mar, 2014 2 commits
  6. 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
  7. 30 Jan, 2014 1 commit
  8. 02 Jan, 2014 1 commit
  9. 30 Dec, 2013 1 commit
  10. 10 Jul, 2013 3 commits
    • Add ignore_submodules to diff options · f9775a37
      This adds correct support for an equivalent to --ignore-submodules
      in diff, where an actual ignore value can be passed to diff to
      override the per submodule settings in the configuration.
      
      This required tweaking the constants for ignore values so that
      zero would not be used and could represent an unset option to the
      diff.  This was an opportunity to move the submodule values into
      include/git2/types.h and to rename the poorly named DEFAULT values
      for ignore and update constants to RESET instead.
      
      Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as
      setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL
      (which is actually a minor change from the old behavior in that
      submodules will now be treated as UNMODIFIED deltas instead of
      being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED).
      
      This includes tests for the various new settings.
      Russell Belfer committed
    • Submodule status improvements · 1aad6137
      This fixes the way that submodule status is checked to bypass just
      about all of the caching in the submodule object.  Based on the
      ignore value, it will try to do the minimum work necessary to find
      the current status of the submodule - but it will actually go to
      disk to get all of the current values.
      
      This also removes the custom refcounting stuff in favor of the
      common git_refcount style.  Right now, it is still for internal
      purposes only, but it should make it easier to add true submodule
      refcounting in the future with a public git_submodule_free call
      that will allow bindings not to worry about the submodule object
      getting freed from underneath them.
      Russell Belfer committed
    • Add timestamp check to submodule status · e807860f
      This is probably not the final form of this change, but this is
      a preliminary version of checking a timestamp to see if the cached
      working directory HEAD OID matches the current.  Right now, this
      uses the timestamp on the index and is, like most of our timestamp
      checking, subject to having only second accuracy.
      Russell Belfer committed
  11. 08 Jan, 2013 1 commit
  12. 24 Aug, 2012 2 commits
    • Working implementation of git_submodule_status · 5f4a61ae
      This is a big redesign of the git_submodule_status API and the
      implementation of the redesigned API.  It also fixes a number of
      bugs that I found in other parts of the submodule API while
      writing the tests for the status part.
      
      This also fixes a couple of bugs in the iterators that had not
      been noticed before - one with iterating when there is a gitlink
      (i.e. separate-work-dir) and one where I was treating anything
      even vaguely submodule-like as a submodule, more aggressively
      than core git does.
      Russell Belfer committed
    • Major submodule rewrite · aa13bf05
      This replaces the old submodule API with a new extended API that
      supports most of the things that can be done with `git submodule`.
      Russell Belfer committed