@ -466,7 +466,6 @@ static void alias_all_urls(void)
static void read_config(void)
static void read_config(void)
{
{
static int loaded;
static int loaded;
struct object_id oid;
int flag;
int flag;
if (loaded)
if (loaded)
@ -475,7 +474,7 @@ static void read_config(void)
current_branch = NULL;
current_branch = NULL;
if (startup_info->have_repository) {
if (startup_info->have_repository) {
const char *head_ref = resolve_ref_unsafe("HEAD", 0, oid.hash, &flag);
const char *head_ref = resolve_ref_unsafe("HEAD", 0, NULL, &flag);
if (head_ref && (flag & REF_ISSYMREF) &&
if (head_ref && (flag & REF_ISSYMREF) &&
skip_prefix(head_ref, "refs/heads/", &head_ref)) {
skip_prefix(head_ref, "refs/heads/", &head_ref)) {
current_branch = make_branch(head_ref, 0);
current_branch = make_branch(head_ref, 0);
@ -1105,10 +1104,9 @@ static struct ref *make_linked_ref(const char *name, struct ref ***tail)
static char *guess_ref(const char *name, struct ref *peer)
static char *guess_ref(const char *name, struct ref *peer)
{
{
struct strbuf buf = STRBUF_INIT;
struct strbuf buf = STRBUF_INIT;
struct object_id oid;
const char *r = resolve_ref_unsafe(peer->name, RESOLVE_REF_READING,
const char *r = resolve_ref_unsafe(peer->name, RESOLVE_REF_READING,
oid.hash, NULL);
NULL, NULL);
if (!r)
if (!r)
return NULL;
return NULL;
@ -1166,12 +1164,11 @@ static int match_explicit(struct ref *src, struct ref *dst,
return -1;
return -1;
if (!dst_value) {
if (!dst_value) {
struct object_id oid;
int flag;
int flag;
dst_value = resolve_ref_unsafe(matched_src->name,
dst_value = resolve_ref_unsafe(matched_src->name,
RESOLVE_REF_READING,
RESOLVE_REF_READING,
oid.hash, &flag);
NULL, &flag);
if (!dst_value ||
if (!dst_value ||
((flag & REF_ISSYMREF) &&
((flag & REF_ISSYMREF) &&
!starts_with(dst_value, "refs/heads/")))
!starts_with(dst_value, "refs/heads/")))
@ -1792,10 +1789,9 @@ const char *branch_get_push(struct branch *branch, struct strbuf *err)
static int ignore_symref_update(const char *refname)
static int ignore_symref_update(const char *refname)
{
{
struct object_id oid;
int flag;
int flag;
if (!resolve_ref_unsafe(refname, 0, oid.hash, &flag))
if (!resolve_ref_unsafe(refname, 0, NULL, &flag))
return 0; /* non-existing refs are OK */
return 0; /* non-existing refs are OK */
return (flag & REF_ISSYMREF);
return (flag & REF_ISSYMREF);
}
}