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

Function make_transient_cache_entry

read-cache.c:874–898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874struct cache_entry *make_transient_cache_entry(unsigned int mode,
875 const struct object_id *oid,
876 const char *path,
877 int stage,
878 struct mem_pool *ce_mem_pool)
879{
880 struct cache_entry *ce;
881 int len;
882
883 if (!verify_path(path, mode)) {
884 error(_("invalid path '%s'"), path);
885 return NULL;
886 }
887
888 len = strlen(path);
889 ce = make_empty_transient_cache_entry(len, ce_mem_pool);
890
891 oidcpy(&ce->oid, oid);
892 memcpy(ce->name, path, len);
893 ce->ce_flags = create_ce_flags(stage);
894 ce->ce_namelen = len;
895 ce->ce_mode = create_ce_mode(mode);
896
897 return ce;
898}
899
900/*
901 * Chmod an index entry with either +x or -x.

Callers 2

checkout_mergedFunction · 0.85
checkout_pathFunction · 0.85

Calls 6

verify_pathFunction · 0.85
errorFunction · 0.85
oidcpyFunction · 0.85
create_ce_flagsFunction · 0.85
create_ce_modeFunction · 0.85

Tested by

no test coverage detected