1. 20 Jul, 2019 1 commit
  2. 10 Jun, 2018 1 commit
  3. 06 Jun, 2018 1 commit
    • tests: submodule: do not rely on config iteration order · 8178c70f
      The test submodule::lookup::duplicated_path, which tries to verify that
      we detect submodules with duplicated paths, currently relies on the
      gitmodules file of "submod2_target". While this file has two gitmodules
      with the same path, one of these gitmodules has an empty name and thus
      does not pass `git_submodule_name_is_valid`. Because of this, the test
      is in fact dependent on the iteration order in which we process the
      submodules. In fact the "valid" submodule comes first, the "invalid"
      submodule will cause the desired error. In fact the "invalid" submodule
      comes first, it will be skipped due to its name being invalid, and we
      will not see the desired error. While this works on the master branch
      just right due to the refactoring of our config code, where iteration
      order is now deterministic, this breaks on all older maintenance
      branches.
      
      Fix the issue by simply using `cl_git_rewritefile` to rewrite the
      gitmodules file. This greatly simplifies the test and also makes the
      intentions of it much clearer.
      Patrick Steinhardt committed
  4. 30 May, 2018 1 commit
    • submodule: detect duplicated submodule paths · b2a389c8
      When loading submodule names, we build a map of submodule paths and
      their respective names. While looping over the configuration keys,
      we do not check though whether a submodule path was seen already. This
      leads to a memory leak in case we have multiple submodules with the same
      path, as we just overwrite the old value in the map in that case.
      
      Fix the error by verifying that the path to be added is not yet part of
      the string map. Git does not allow to have multiple submodules for a
      path anyway, so we now do the same and detect this duplication,
      reporting it to the user.
      Patrick Steinhardt committed
  5. 27 Mar, 2018 1 commit
  6. 25 Aug, 2017 3 commits
    • submodule: refuse lookup in bare repositories · 477b3e04
      While it is technically possible to look up submodules inside of a
      bare repository by reading the submodule configuration of a specific
      commit, we do not offer this functionality right now. As such, calling
      both `git_submodule_lookup` and `git_submodule_foreach` should error out
      early when these functions encounter a bare repository. While
      `git_submodule_lookup` already does return an error due to not being
      able to parse the configuration, `git_submodule_foreach` simply returns
      success and never invokes the callback function.
      
      Fix the issue by having both functions check whether the repository is
      bare and returning an error in that case.
      Patrick Steinhardt committed
    • tests: submodule: fix declaration of test · 64d1e0b3
      The testcase "submodule::lookup::cached" was declared with a single
      underscore separating the test suide and test name, only. As the clar
      parser only catches tests with two underscores, it was never executed.
      Add in the second underscore to actually have it detected and executed.
      Patrick Steinhardt committed
  7. 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
  8. 21 Dec, 2015 1 commit
  9. 18 Sep, 2015 1 commit
  10. 10 Sep, 2015 1 commit
  11. 13 Jul, 2015 1 commit
  12. 11 Jul, 2015 1 commit
  13. 01 Jul, 2015 1 commit
  14. 29 Jun, 2015 1 commit
  15. 03 Mar, 2015 1 commit
    • Remove the signature from ref-modifying functions · 659cf202
      The signature for the reflog is not something which changes
      dynamically. Almost all uses will be NULL, since we want for the
      repository's default identity to be used, making it noise.
      
      In order to allow for changing the identity, we instead provide
      git_repository_set_ident() and git_repository_ident() which allow a user
      to override the choice of signature.
      Carlos Martín Nieto committed
  16. 22 Dec, 2014 1 commit
    • Introduce a convenience function for submodule update · 9d1f97df
      This introduces the functionality of submodule update in
      'git_submodule_do_update'. The existing 'git_submodule_update' function is
      renamed to 'git_submodule_update_strategy'. The 'git_submodule_update'
      function now refers to functionality similar to `git submodule update`,
      while `git_submodule_update_strategy` is used to get the configured value
      of submodule.<name>.update.
      Jameson Miller committed
  17. 01 Apr, 2014 2 commits
    • More tests and fix submodule index refresh · 8f4e5275
      There was a little bug where the submodule cache thought that the
      index date was out of date even when it wasn't that was resulting
      in some extra scans of index data even when not needed.
      
      Mostly this commit adds a bunch of new tests including adding and
      removing submodules in the index and in the HEAD and seeing if we
      can automatically pick them up when refreshing.
      Russell Belfer committed
    • Remove most submodule reloads from tests · 8061d519
      With the new submodule cache validity checks, we generally don't
      need to call git_submodule_reload_all to have up-to-date submodule
      data.  Some tests are still calling it where I want to actually
      test that it can be called safely and doesn't break anything, but
      mostly it is not needed.
      
      This also expands some of the existing submodule tests to cover
      some variants on the behavior that was already being tested.
      Russell Belfer committed
  18. 26 Mar, 2014 1 commit
    • Fix error when submodule path and name differ · 380f864a
      When a submodule was inserted with a different path and name, the
      return value from khash greater than zero was allowed to propagate
      back out to the caller when it should really be zeroed.  This led
      to a possible crash when reloading submodules if that was the
      first time that submodule data was loaded.
      Russell Belfer committed
  19. 25 Mar, 2014 1 commit
    • 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
  20. 15 Jan, 2014 1 commit
  21. 14 Nov, 2013 1 commit
  22. 08 Oct, 2013 1 commit
    • More filemode cleanups for FAT on MacOS · 14997dc5
      This cleans up some additional issues.  The main change is that
      on a filesystem that doesn't support mode bits, libgit2 will now
      create new blobs with GIT_FILEMODE_BLOB always instead of being
      at the mercy to the filesystem driver to report executable or not.
      This means that if "core.filemode" lies and claims that filemode
      is not supported, then we will ignore the executable bit from the
      filesystem.  Previously we would have allowed it.
      
      This adds an option to the new git_repository_reset_filesystem to
      recurse through submodules if desired.  There may be other types
      of APIs that would like a "recurse submodules" option, but this
      one is particularly useful.
      
      This also has a number of cleanups, etc., for related things
      including trying to give better error messages when problems come
      up from the filesystem.  For example, the FAT filesystem driver on
      MacOS appears to return errno EINVAL if you attempt to write a
      filename with invalid UTF-8 in it.  We try to capture that with a
      better error message now.
      Russell Belfer committed
  23. 17 Sep, 2013 1 commit
    • No such thing as an orphan branch · 605da51a
      Unfortunately git-core uses the term "unborn branch" and "orphan
      branch" interchangeably. However, "orphan" is only really there for
      the checkout command, which has the `--orphan` option so it doesn't
      actually create the branch.
      
      Branches never have parents, so the distinction of a branch with no
      parents is odd to begin with. Crucially, the error messages deal with
      unborn branches, so let's use that.
      Carlos Martín Nieto committed
  24. 28 Jun, 2013 1 commit
  25. 19 Mar, 2013 1 commit
    • Three submodule status bug fixes · 65025cb8
      1. Fix sort order problem with submodules where "mod" was sorting
         after "mod-plus" because they were being sorted as "mod/" and
         "mod-plus/".  This involved pushing the "contains a .git entry"
         test significantly lower in the stack.
      2. Reinstate behavior that a directory which contains a .git entry
         will be treated as a submodule during iteration even if it is
         not yet added to the .gitmodules.
      3. Now that any directory containing .git is reported as submodule,
         we have to be more careful checking for GIT_EEXISTS when we
         do a submodule lookup, because that is the error code that is
         returned by git_submodule_lookup when you try to look up a
         directory containing .git that has no record in gitmodules or
         the index.
      Russell Belfer committed
  26. 27 Nov, 2012 1 commit
  27. 05 Sep, 2012 1 commit
  28. 24 Aug, 2012 1 commit