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

Function remove_file_from_index

read-cache.c:629–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629int remove_file_from_index(struct index_state *istate, const char *path)
630{
631 int pos = index_name_pos(istate, path, strlen(path));
632 if (pos < 0)
633 pos = -pos-1;
634 cache_tree_invalidate_path(istate, path);
635 untracked_cache_remove_from_index(istate, path);
636 while (pos < istate->cache_nr && !strcmp(istate->cache[pos]->name, path))
637 remove_index_entry_at(istate, pos);
638 return 0;
639}
640
641static int compare_name(struct cache_entry *ce, const char *path, int namelen)
642{

Callers 12

run_updateFunction · 0.85
revert_from_diffFunction · 0.85
remove_fileFunction · 0.85
update_callbackFunction · 0.85
update_index_from_diffFunction · 0.85
add_remove_filesFunction · 0.85
remove_one_pathFunction · 0.85
process_pathFunction · 0.85
update_oneFunction · 0.85
read_index_infoFunction · 0.85
cmd_rmFunction · 0.85

Calls 4

index_name_posFunction · 0.85
remove_index_entry_atFunction · 0.85

Tested by

no test coverage detected