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

Function main

gitless/cli/gl_branch.py:62–88  ·  view source on GitHub ↗
(args, repo)

Source from the content-addressed store, hash-verified

60
61
62def main(args, repo):
63 is_list = bool(args.verbose or args.remote)
64 is_create = bool(args.create_b or args.dp)
65 is_delete = bool(args.delete_b)
66 is_edit = bool(args.new_head or args.upstream_b or args.unset_upstream)
67
68 if is_list + is_create + is_delete + is_edit > 1:
69 pprint.err('Invalid flag combination')
70 pprint.err_exp(
71 'Can only do one of list, create, delete, or edit branches at a time')
72 return False
73
74 ret = True
75 if args.create_b:
76 ret = _do_create(args.create_b, args.dp or 'HEAD', repo)
77 elif args.delete_b:
78 ret = _do_delete(args.delete_b, repo)
79 elif args.upstream_b:
80 ret = _do_set_upstream(args.upstream_b, repo)
81 elif args.unset_upstream:
82 ret = _do_unset_upstream(repo)
83 elif args.new_head:
84 ret = _do_set_head(args.new_head, repo)
85 else:
86 _do_list(repo, args.remote, v=args.verbose)
87
88 return ret
89
90
91def _do_list(repo, list_remote, v=False):

Callers

nothing calls this directly

Calls 6

_do_set_upstreamFunction · 0.85
_do_unset_upstreamFunction · 0.85
_do_set_headFunction · 0.85
_do_createFunction · 0.70
_do_deleteFunction · 0.70
_do_listFunction · 0.70

Tested by

no test coverage detected