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

Function test_head_id_null

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

Source from the content-addressed store, hash-verified

226
227@utils.requires_network
228def test_head_id_null(repo: Repository) -> None:
229 gitmodules_newlines = (
230 '\n'
231 '[submodule "uncommitted_submodule"]\n'
232 ' path = pygit2\n'
233 ' url = https://github.com/libgit2/pygit2\n'
234 '\n'
235 )
236 with open(Path(repo.workdir, '.gitmodules'), 'a') as f:
237 f.write(gitmodules_newlines)
238
239 subm = repo.submodules['uncommitted_submodule']
240
241 # The submodule isn't in the HEAD yet, so head_id should be None
242 assert subm.head_id is None
243
244
245@utils.requires_network

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…