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

Function chmod_index_entry

read-cache.c:907–928  ·  view source on GitHub ↗

* Chmod an index entry with either +x or -x. * * Returns -1 if the chmod for the particular cache entry failed (if it's * not a regular file), -2 if an invalid flip argument is passed in, 0 * otherwise. */

Source from the content-addressed store, hash-verified

905 * otherwise.
906 */
907int chmod_index_entry(struct index_state *istate, struct cache_entry *ce,
908 char flip)
909{
910 if (!S_ISREG(ce->ce_mode))
911 return -1;
912 switch (flip) {
913 case '+':
914 ce->ce_mode |= 0111;
915 break;
916 case '-':
917 ce->ce_mode &= ~0111;
918 break;
919 default:
920 return -2;
921 }
922 cache_tree_invalidate_path(istate, ce->name);
923 ce->ce_flags |= CE_UPDATE_IN_BASE;
924 mark_fsmonitor_invalid(istate, ce);
925 istate->cache_changed |= CE_ENTRY_CHANGED;
926
927 return 0;
928}
929
930int ce_same_name(const struct cache_entry *a, const struct cache_entry *b)
931{

Callers 2

chmod_pathspecFunction · 0.85
chmod_pathFunction · 0.85

Calls 2

mark_fsmonitor_invalidFunction · 0.85

Tested by

no test coverage detected