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

Function add_remove_files

builtin/commit.c:292–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292static void add_remove_files(struct string_list *list)
293{
294 int i;
295 for (i = 0; i < list->nr; i++) {
296 struct stat st;
297 struct string_list_item *p = &(list->items[i]);
298
299 /* p->util is skip-worktree */
300 if (p->util)
301 continue;
302
303 if (!lstat(p->string, &st)) {
304 if (add_to_index(the_repository->index, p->string, &st, 0))
305 die(_("updating files failed"));
306 } else
307 remove_file_from_index(the_repository->index, p->string);
308 }
309}
310
311static void create_base_index(const struct commit *current_head)
312{

Callers 1

prepare_indexFunction · 0.85

Calls 3

add_to_indexFunction · 0.85
remove_file_from_indexFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected