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

Function test_checkout_index

test/test_repository.py:233–241  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

231
232
233def test_checkout_index(testrepo: Repository) -> None:
234 # some changes to working dir
235 with (Path(testrepo.workdir) / 'hello.txt').open('w') as f:
236 f.write('new content')
237
238 # checkout index
239 assert 'hello.txt' in testrepo.status()
240 testrepo.checkout(strategy=CheckoutStrategy.FORCE)
241 assert 'hello.txt' not in testrepo.status()
242
243
244def test_checkout_head(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 4

openMethod · 0.80
statusMethod · 0.80
checkoutMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…