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

Function _print_untracked_files

gitless/cli/gl_status.py:104–132  ·  view source on GitHub ↗
(untracked_list, relative_paths, repo)

Source from the content-addressed store, hash-verified

102
103
104def _print_untracked_files(untracked_list, relative_paths, repo):
105 pprint.msg('Untracked files:')
106 pprint.exp('these won\'t be considered for commit')
107 pprint.exp('use gl track f if you want to track changes to file f')
108 pprint.blank()
109
110 if not untracked_list:
111 pprint.item('There are no untracked files to list')
112 return
113
114 root = repo.root
115 for f in untracked_list:
116 exp = ''
117 color = colored.blue
118 if f.in_conflict:
119 exp = ' (with conflicts)'
120 color = colored.cyan
121 elif f.exists_at_head:
122 color = colored.magenta
123 if f.exists_in_wd:
124 exp = ' (exists at head)'
125 else:
126 exp = ' (exists at head but not in working directory)'
127
128 fp = os.path.relpath(os.path.join(root, f.fp)) if relative_paths else f.fp
129 if fp == '.':
130 continue
131
132 pprint.item(color(fp), opt_text=exp)
133
134
135def _print_conflict_exp(op):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected