MCPcopy Index your code
hub / github.com/git/git / make_cache_entry

Function make_cache_entry

read-cache.c:844–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844struct cache_entry *make_cache_entry(struct index_state *istate,
845 unsigned int mode,
846 const struct object_id *oid,
847 const char *path,
848 int stage,
849 unsigned int refresh_options)
850{
851 struct cache_entry *ce, *ret;
852 int len;
853
854 if (verify_path_internal(path, mode) == PATH_INVALID) {
855 error(_("invalid path '%s'"), path);
856 return NULL;
857 }
858
859 len = strlen(path);
860 ce = make_empty_cache_entry(istate, len);
861
862 oidcpy(&ce->oid, oid);
863 memcpy(ce->name, path, len);
864 ce->ce_flags = create_ce_flags(stage);
865 ce->ce_namelen = len;
866 ce->ce_mode = create_ce_mode(mode);
867
868 ret = refresh_cache_entry(istate, ce, refresh_options);
869 if (ret != ce)
870 discard_cache_entry(ce);
871 return ret;
872}
873
874struct cache_entry *make_transient_cache_entry(unsigned int mode,
875 const struct object_id *oid,

Callers 9

unmerge_index_entryFunction · 0.85
revert_from_diffFunction · 0.85
build_fake_ancestorFunction · 0.85
add_path_to_indexFunction · 0.85
update_index_from_diffFunction · 0.85
run_dir_diffFunction · 0.85

Calls 8

verify_path_internalFunction · 0.85
errorFunction · 0.85
make_empty_cache_entryFunction · 0.85
oidcpyFunction · 0.85
create_ce_flagsFunction · 0.85
create_ce_modeFunction · 0.85
refresh_cache_entryFunction · 0.85
discard_cache_entryFunction · 0.85

Tested by

no test coverage detected