git-2.22.0/rerere.c
/*
 * Look at a cache entry at "i" and see if it is not conflicting,
 * conflicting and we are willing to handle, or conflicting and
 * we are unable to handle, and return the determination in *type.
 * Return the cache index to be looked at next, by skipping the
 * stages we have already looked at in this invocation of this
 * function.
 */
Look at a cache entry at "i" and see if it is not conflicting,
conflicting and we are willing to handle, or conflicting and
we are unable to handle, and return the determination in *type.
Return the cache index to be looked at next, by skipping the
stages we have already looked at in this invocation of this
function.
Look at a cache entry at " i " and see if it is not conflicting conflicting and we are willing to handle or conflicting and we are unable to handle and return the determination in * type . Return the cache index to be looked at next by skipping the stages we have already looked at in this invocation of this function .
static int check_one_conflict(struct index_state *istate, int i, int *type)
{
	const struct cache_entry *e = istate->cache[i];
	if (!ce_stage(e)) {
		*type = RESOLVED;
		return i + 1;
	}
	*type = PUNTED;
	while (i < istate->cache_nr && ce_stage(istate->cache[i]) == 1)
		i++;
	if (i + 1 < istate->cache_nr) {
		const struct cache_entry *e2 = istate->cache[i];
		const struct cache_entry *e3 = istate->cache[i + 1];
		if (ce_stage(e2) == 2 &&
		    ce_stage(e3) == 3 &&
		    ce_same_name(e, e3) &&
		    S_ISREG(e2->ce_mode) &&
		    S_ISREG(e3->ce_mode))
			*type = THREE_STAGED;
	}
	while (i < istate->cache_nr && ce_same_name(e, istate->cache[i]))
		i++;
	return i;
}
static int check_one_conflict ( struct index_state * istate , int i , int * type ) { const struct cache_entry * e = istate -> cache [ i ] ; if ( ! ce_stage ( e ) ) { * type = RESOLVED ; return i + 1 ; } * type = PUNTED ; while ( i < istate -> cache_nr && ce_stage ( istate -> cache [ i ] ) == 1 ) i ++ ; if ( i + 1 < istate -> cache_nr ) { const struct cache_entry * e2 = istate -> cache [ i ] ; const struct cache_entry * e3 = istate -> cache [ i + 1 ] ; if ( ce_stage ( e2 ) == 2 && ce_stage ( e3 ) == 3 && ce_same_name ( e , e3 ) && S_ISREG ( e2 -> ce_mode ) && S_ISREG ( e3 -> ce_mode ) ) * type = THREE_STAGED ; } while ( i < istate -> cache_nr && ce_same_name ( e , istate -> cache [ i ] ) ) i ++ ; return i ; }
Look at a cache entry at "i" and see if it is not conflicting,
 conflicting and we are willing to handle, or conflicting and
 we are unable to handle, and return the determination in *type.
Look at a cache entry at " i " and see if it is not conflicting conflicting and we are willing to handle or conflicting and we are unable to handle and return the determination in * type .
/* Only handle regular files with both stages #2 and #3 */ /* Skip the entries with the same name */