MCPcopy Index your code
hub / github.com/cosmicpython/book / main

Function main

update-exercise-branch.py:24–35  ·  view source on GitHub ↗
(chapter)

Source from the content-addressed store, hash-verified

22
23
24def main(chapter):
25 exercise_chapter = f'{chapter}_exercise'
26 assert exercise_chapter in all_branches
27
28 run(['git', 'checkout', exercise_chapter])
29 commits = list(reversed(run([
30 'git', 'log', '--pretty=%h',
31 f'{exercise_chapter}^{{/{chapter}_ends}}..{exercise_chapter}',
32 ]).split()))
33 run(['git', 'reset', '--hard', chapter])
34 run(['git', 'cherry-pick', *commits])
35 run(['git', 'checkout', 'master'])
36
37if __name__ == '__main__':
38 main(sys.argv[1])

Callers 1

Calls 1

runFunction · 0.70

Tested by

no test coverage detected