MCPcopy Create free account
hub / github.com/codecombat/codecombat / find_targets

Function find_targets

scripts/merge-git.py:3–16  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

1from pygit2 import discover_repository, Repository, Signature, GIT_OBJ_TREE, GIT_FILEMODE_BLOB, GIT_FILEMODE_TREE
2
3def find_targets(tree):
4 targets = []
5 def walk(t, path):
6 for o in t:
7 if o.type == GIT_OBJ_TREE:
8 walk(o, path + [o.name])
9
10 other = o.name.replace("coco", "ozar")
11 if o.name != other and other in t and o.id == t[other].id:
12 targets.append(path + [o.name])
13
14
15 walk(tree, [])
16 return targets
17
18
19repository_path = discover_repository(__file__ )

Callers 1

merge-git.pyFile · 0.85

Calls 1

walkFunction · 0.70

Tested by

no test coverage detected