*
* If the ref is symbolic, fill in *symref with the referrent
* (e.g. "refs/heads/master") and return 0. The caller is responsible
*
* If the ref is symbolic, fill in *symref with the referrent
* (e.g. "refs/heads/master") and return 0. The caller is responsible
*
* If the ref doesn't exist, set errno to ENOENT and return -1.
*
* If the ref exists but is neither a symbolic ref nor a sha1, it is
*
* If the ref doesn't exist, set errno to ENOENT and return -1.
*
* If the ref exists but is neither a symbolic ref nor a sha1, it is
* refname will still be valid and unchanged.
*/
int read_raw_ref(const char *refname, unsigned char *sha1,
* refname will still be valid and unchanged.
*/
int read_raw_ref(const char *refname, unsigned char *sha1,
if (starts_with(sb_contents.buf, "refs/") &&
!check_refname_format(sb_contents.buf, 0)) {
strbuf_swap(&sb_contents, symref);
if (starts_with(sb_contents.buf, "refs/") &&
!check_refname_format(sb_contents.buf, 0)) {
strbuf_swap(&sb_contents, symref);
*/
if (get_sha1_hex(buf, sha1) ||
(buf[40] != '\0' && !isspace(buf[40]))) {
*/
if (get_sha1_hex(buf, sha1) ||
(buf[40] != '\0' && !isspace(buf[40]))) {