MCPcopy Create free account
hub / github.com/gitless-vcs/gitless / main

Function main

gitless/cli/file_cmd.py:31–51  ·  view source on GitHub ↗
(subcmd)

Source from the content-addressed store, hash-verified

29
30
31def main(subcmd):
32 def f(args, repo):
33 curr_b = repo.current_branch
34 success = True
35
36 for fp in args.files:
37 try:
38 getattr(curr_b, subcmd + '_file')(fp)
39 pprint.ok(
40 'File {0} is now a{1} {2}{3}d file'.format(
41 fp, 'n' if subcmd.startswith(VOWELS) else '', subcmd,
42 '' if subcmd.endswith('e') else 'e'))
43 except KeyError:
44 pprint.err('Can\'t {0} non-existent file {1}'.format(subcmd, fp))
45 success = False
46 except ValueError as e:
47 pprint.err(e)
48 success = False
49
50 return success
51 return f

Callers 1

fFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected