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

Function test_reset_hard

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

Source from the content-addressed store, hash-verified

333
334
335def test_reset_hard(testrepo: Repository) -> None:
336 ref = '5ebeeebb320790caf276b9fc8b24546d63316533'
337 with (Path(testrepo.workdir) / 'hello.txt').open() as f:
338 lines = f.readlines()
339 assert 'hola mundo\n' in lines
340 assert 'bonjour le monde\n' in lines
341
342 testrepo.reset(ref, ResetMode.HARD)
343 assert testrepo.head.target == ref
344
345 with (Path(testrepo.workdir) / 'hello.txt').open() as f:
346 lines = f.readlines()
347 # Hard reset will reset the working copy too
348 assert 'hola mundo\n' not in lines
349 assert 'bonjour le monde\n' not in lines
350
351
352def test_reset_soft(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

openMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…