| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4b4e47f commit ef7568e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -270,7 +270,7 @@ def _config_parser( | |||
| 270 | 270 | raise ValueError("Cannot write blobs of 'historical' submodule configurations") | |
| 271 | 271 | # END handle writes of historical submodules | |
| 272 | 272 | ||
| 273 | - return SubmoduleConfigParser(fp_module, read_only=read_only) | ||
| 273 | + return SubmoduleConfigParser(fp_module, read_only=read_only, merge_includes=False) | ||
| 274 | 274 | ||
| 275 | 275 | def _clear_cache(self) -> None: | |
| 276 | 276 | """Clear the possibly changed values.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1207,6 +1207,22 @@ def test_ignore_non_submodule_file(self, rwdir): | |||
| 1207 | 1207 | ||
| 1208 | 1208 | assert len(parent.submodules) == 0 | |
| 1209 | 1209 | ||
| 1210 | + @with_rw_directory | ||
| 1211 | + def test_gitmodules_does_not_merge_includes(self, rwdir): | ||
| 1212 | + parent = git.Repo.init(rwdir) | ||
| 1213 | + secret_path = osp.join(rwdir, "secret") | ||
| 1214 | + with open(secret_path, "w", encoding="utf-8") as secret: | ||
| 1215 | + secret.write("not git config\n") | ||
| 1216 | + with open(osp.join(rwdir, ".gitmodules"), "w", encoding="utf-8") as modules: | ||
| 1217 | + modules.write('[submodule "module"]\n') | ||
| 1218 | + modules.write("\tpath = module\n") | ||
| 1219 | + modules.write("\turl = https://example.com/module.git\n") | ||
| 1220 | + modules.write("[include]\n") | ||
| 1221 | + modules.write("\tpath = %s\n" % secret_path) | ||
| 1222 | + | ||
| 1223 | + parser = Submodule._config_parser(parent, None, read_only=True) | ||
| 1224 | + self.assertEqual(parser.get_value('submodule "module"', "path"), "module") | ||
| 1225 | + | ||
| 1210 | 1226 | @with_rw_directory | |
| 1211 | 1227 | def test_remove_norefs(self, rwdir): | |
| 1212 | 1228 | parent = git.Repo.init(osp.join(rwdir, "parent")) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments