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

Function test_remote_prune

test/test_remote_prune.py:63–78  ·  view source on GitHub ↗
(clonerepo: Repository)

Source from the content-addressed store, hash-verified

61
62
63def test_remote_prune(clonerepo: Repository) -> None:
64 pruned = []
65
66 class MyCallbacks(pygit2.RemoteCallbacks):
67 def update_tips(self, name: str, old: Oid, new: Oid) -> None:
68 pruned.append(name)
69
70 callbacks = MyCallbacks()
71 remote = clonerepo.remotes['origin']
72 # We do a fetch in order to establish the connection to the remote.
73 # Prune operation requires an active connection.
74 remote.fetch(prune=FetchPrune.NO_PRUNE)
75 assert 'origin/i18n' in clonerepo.branches
76 remote.prune(callbacks)
77 assert pruned == ['refs/remotes/origin/i18n']
78 assert 'origin/i18n' not in clonerepo.branches

Callers

nothing calls this directly

Calls 3

fetchMethod · 0.80
pruneMethod · 0.80
MyCallbacksClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…