MCPcopy Create free account
hub / github.com/git/git / list

Function list

add-interactive.c:178–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176};
177
178static void list(struct add_i_state *s, struct string_list *list, int *selected,
179 struct list_options *opts)
180{
181 int i, last_lf = 0;
182
183 if (!list->nr)
184 return;
185
186 if (opts->header)
187 color_fprintf_ln(stdout, s->cfg.header_color,
188 "%s", opts->header);
189
190 for (i = 0; i < list->nr; i++) {
191 opts->print_item(i, selected ? selected[i] : 0, list->items + i,
192 opts->print_item_data);
193
194 if ((opts->columns) && ((i + 1) % (opts->columns))) {
195 putchar('\t');
196 last_lf = 0;
197 }
198 else {
199 putchar('\n');
200 last_lf = 1;
201 }
202 }
203
204 if (!last_lf)
205 putchar('\n');
206}
207struct list_and_choose_options {
208 struct list_options list_opts;
209

Callers 2

list_and_chooseFunction · 0.70
run_statusFunction · 0.70

Calls 1

color_fprintf_lnFunction · 0.85

Tested by

no test coverage detected