MCPcopy
hub / github.com/gitless-vcs/gitless / main

Function main

gitless/cli/gl_switch.py:27–38  ·  view source on GitHub ↗
(args, repo)

Source from the content-addressed store, hash-verified

25
26
27def main(args, repo):
28 b = repo.lookup_branch(args.branch)
29
30 if not b:
31 pprint.err('Branch {0} doesn\'t exist'.format(args.branch))
32 pprint.err_exp('to list existing branches do gl branch')
33 pprint.err_exp('to create a new branch do gl branch -c {0}'.format(args.branch))
34 return False
35
36 repo.switch_current_branch(b, move_over=args.move_over)
37 pprint.ok('Switched to branch {0}'.format(args.branch))
38 return True

Callers

nothing calls this directly

Calls 2

switch_current_branchMethod · 0.80
lookup_branchMethod · 0.45

Tested by

no test coverage detected