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

Function _do_partial_selection

gitless/cli/gl_commit.py:99–114  ·  view source on GitHub ↗
(files, curr_b)

Source from the content-addressed store, hash-verified

97
98
99def _do_partial_selection(files, curr_b):
100 partials = []
101 for fp in files:
102 f_st = curr_b.status_file(fp)
103 if not f_st.exists_at_head:
104 pprint.warn('Can\'t select segments for new file {0}'.format(fp))
105 continue
106 if not f_st.exists_in_wd:
107 pprint.warn('Can\'t select segments for deleted file {0}'.format(fp))
108 continue
109
110 subprocess.call(['git', 'add', '-p', fp])
111 # TODO: check that at least one hunk was staged
112 partials.append(fp)
113
114 return partials
115
116
117def _auto_track(files, curr_b):

Callers 1

mainFunction · 0.85

Calls 1

status_fileMethod · 0.80

Tested by

no test coverage detected