| 872 | } |
| 873 | |
| 874 | struct 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. |
no test coverage detected