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

Function test_refs_set_target_with_message

test/test_refs.py:145–158  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

143
144
145def test_refs_set_target_with_message(testrepo: Repository) -> None:
146 reference = testrepo.references.get('HEAD')
147 assert reference is not None
148 assert reference.target == 'refs/heads/master'
149 assert reference.raw_target == b'refs/heads/master'
150 sig = Signature('foo', 'bar')
151 testrepo.set_ident('foo', 'bar')
152 msg = 'Hello log'
153 reference.set_target('refs/heads/i18n', message=msg)
154 assert reference.target == 'refs/heads/i18n'
155 assert reference.raw_target == b'refs/heads/i18n'
156 first = list(reference.log())[0]
157 assert first.message == msg
158 assert first.committer == sig
159
160
161def test_refs_delete(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 3

set_identMethod · 0.80
set_targetMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…