MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_submodule_reload

Function test_submodule_reload

test/test_submodule.py:334–349  ·  view source on GitHub ↗
(repo: Repository)

Source from the content-addressed store, hash-verified

332
333
334def test_submodule_reload(repo: Repository) -> None:
335 sm = repo.submodules[SUBM_NAME]
336 assert sm.url == 'https://github.com/libgit2/TestGitRepository'
337
338 # Doctor the config file outside of libgit2
339 with open(Path(repo.workdir, '.gitmodules'), 'wt') as f:
340 f.write('[submodule "TestGitRepository"]\n')
341 f.write('\tpath = TestGitRepository\n')
342 f.write('\turl = https://github.com/libgit2/pygit2\n')
343
344 # Submodule object is oblivious to the change
345 assert sm.url == 'https://github.com/libgit2/TestGitRepository'
346
347 # Tell it to refresh its cache
348 sm.reload()
349 assert sm.url == 'https://github.com/libgit2/pygit2'

Callers

nothing calls this directly

Calls 2

reloadMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…