summaryrefslogtreecommitdiff
path: root/tests/diff/blob.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-06-06 09:23:01 +0200
committerPatrick Steinhardt <ps@pks.im>2018-06-06 11:32:14 +0200
commit8178c70ff43efdc0f176f32a7b6e5c8f55f3e67c (patch)
tree04fec61aa321216b3716229509ae8d691be0dfaa /tests/diff/blob.c
parent54990d757c8abd4b63aac5f255b5219d3fb9d98e (diff)
downloadlibgit2-8178c70ff43efdc0f176f32a7b6e5c8f55f3e67c.tar.gz
tests: submodule: do not rely on config iteration order
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.
Diffstat (limited to 'tests/diff/blob.c')
0 files changed, 0 insertions, 0 deletions