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

Function test_set_target_with_message

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

Source from the content-addressed store, hash-verified

584
585
586def test_set_target_with_message(testrepo: Repository) -> None:
587 reference = testrepo.lookup_reference('HEAD')
588 assert reference.target == 'refs/heads/master'
589 assert reference.raw_target == b'refs/heads/master'
590 sig = Signature('foo', 'bar')
591 testrepo.set_ident('foo', 'bar')
592 msg = 'Hello log'
593 reference.set_target('refs/heads/i18n', message=msg)
594 assert reference.target == 'refs/heads/i18n'
595 assert reference.raw_target == b'refs/heads/i18n'
596 first = list(reference.log())[0]
597 assert first.message == msg
598 # Signature.time and Signature.encoding may not be equal.
599 # Here we only care that the name and email are correctly set.
600 assert first.committer.name == sig.name
601 assert first.committer.email == sig.email
602
603
604def test_delete(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

set_identMethod · 0.80
set_targetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…