1. 06 Jun, 2018 4 commits
    • tests: submodule: do not rely on config iteration order · 35865117
      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
    • submodule: detect duplicated submodule paths · 7392799d
      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
  2. 30 May, 2018 24 commits
  3. 29 May, 2018 12 commits