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

Function test_oneshot_update_instance

test/test_submodule.py:207–219  ·  view source on GitHub ↗
(repo: Repository, depth: int)

Source from the content-addressed store, hash-verified

205@utils.requires_network
206@pytest.mark.parametrize('depth', [0, 1])
207def test_oneshot_update_instance(repo: Repository, depth: int) -> None:
208 subrepo_file_path = Path(repo.workdir) / SUBM_PATH / 'master.txt'
209 assert not subrepo_file_path.exists()
210 sm = repo.submodules[SUBM_NAME]
211 sm.update(init=True, depth=depth)
212 assert subrepo_file_path.exists()
213
214 sm_repo = sm.open()
215 if depth == 0:
216 sm_repo[SUBM_BOTTOM_SHA] # full history must be available
217 else:
218 with pytest.raises(KeyError):
219 sm_repo[SUBM_BOTTOM_SHA] # shallow clone
220
221
222@utils.requires_network

Callers

nothing calls this directly

Calls 3

existsMethod · 0.80
openMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…