git-2.22.0/refs/ref-cache.c
/*
 * Emit a warning and return true iff ref1 and ref2 have the same name
 * and the same oid. Die if they have the same name but different
 * oids.
 */
Emit a warning and return true iff ref1 and ref2 have the same name
and the same oid. Die if they have the same name but different
oids.
Emit a warning and return true iff ref1 and ref2 have the same name and the same oid . Die if they have the same name but different oids .
static int is_dup_ref(const struct ref_entry *ref1, const struct ref_entry *ref2)
{
	if (strcmp(ref1->name, ref2->name))
		return 0;
	if ((ref1->flag & REF_DIR) || (ref2->flag & REF_DIR))
		die("Reference directory conflict: %s", ref1->name);
	if (!oideq(&ref1->u.value.oid, &ref2->u.value.oid))
		die("Duplicated ref, and SHA1s don't match: %s", ref1->name);
	warning("Duplicated ref: %s", ref1->name);
	return 1;
}
static int is_dup_ref ( const struct ref_entry * ref1 , const struct ref_entry * ref2 ) { if ( strcmp ( ref1 -> name , ref2 -> name ) ) return 0 ; if ( ( ref1 -> flag & REF_DIR ) || ( ref2 -> flag & REF_DIR ) ) die ( " " , ref1 -> name ) ; if ( ! oideq ( & ref1 -> u . value . oid , & ref2 -> u . value . oid ) ) die ( " " , ref1 -> name ) ; warning ( " " , ref1 -> name ) ; return 1 ; }
Emit a warning and return true iff ref1 and ref2 have the same name
 and the same oid.
Emit a warning and return true iff ref1 and ref2 have the same name and the same oid .
/* Duplicate name; make sure that they don't conflict: */ /* This is impossible by construction */