git-2.22.0/refs/packed-backend.c
/*
 * Write an entry to the packed-refs file for the specified refname.
 * If peeled is non-NULL, write it as the entry's peeled value. On
 * error, return a nonzero value and leave errno set at the value left
 * by the failing call to `fprintf()`.
 */
Write an entry to the packed-refs file for the specified refname.
If peeled is non-NULL, write it as the entry's peeled value. On
error, return a nonzero value and leave errno set at the value left
by the failing call to `fprintf()`.
Write an entry to the packed - refs file for the specified refname . If peeled is non - NULL write it as the entry ' s peeled value . On error return a nonzero value and leave errno set at the value left by the failing call to ` fprintf () ` .
static int write_packed_entry(FILE *fh, const char *refname,
			      const struct object_id *oid,
			      const struct object_id *peeled)
{
	if (fprintf(fh, "%s %s\n", oid_to_hex(oid), refname) < 0 ||
	    (peeled && fprintf(fh, "^%s\n", oid_to_hex(peeled)) < 0))
		return -1;
	return 0;
}
static int write_packed_entry ( FILE * fh , const char * refname , const struct object_id * oid , const struct object_id * peeled ) { if ( fprintf ( fh , " \n " , oid_to_hex ( oid ) , refname ) < 0 || ( peeled && fprintf ( fh , " \n " , oid_to_hex ( peeled ) ) < 0 ) ) return -1 ; return 0 ; }
Write an entry to the packed-refs file for the specified refname.
Write an entry to the packed - refs file for the specified refname .