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

Function test_set_head

test/test_repository_bare.py:64–71  ·  view source on GitHub ↗
(barerepo: Repository)

Source from the content-addressed store, hash-verified

62
63
64def test_set_head(barerepo: Repository) -> None:
65 # Test setting a detached HEAD.
66 barerepo.set_head(pygit2.Oid(hex=PARENT_SHA))
67 assert barerepo.head.target == PARENT_SHA
68 # And test setting a normal HEAD.
69 barerepo.set_head('refs/heads/master')
70 assert barerepo.head.name == 'refs/heads/master'
71 assert barerepo.head.target == HEAD_SHA
72
73
74def test_read(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

set_headMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…