X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=remote.c;h=b8ecfa5d9558e3824872ad6778fc344681cc8d5c;hb=6cf5b81f3236ddc3be9967dc59dc948efbfbbeea;hp=ca42a126ad04514f0ed8378768ebce98cfc5a659;hpb=22d9b7937054c90aea035afee8ebfa90bba2f7f9;p=git.git diff --git a/remote.c b/remote.c index ca42a126a..b8ecfa5d9 100644 --- a/remote.c +++ b/remote.c @@ -896,7 +896,7 @@ struct ref *alloc_ref(const char *name) return alloc_ref_with_prefix("", 0, name); } -static struct ref *copy_ref(const struct ref *ref) +struct ref *copy_ref(const struct ref *ref) { struct ref *cpy; size_t len; @@ -1667,7 +1667,9 @@ struct ref *guess_remote_head(const struct ref *head, /* Look for another ref that points there */ for (r = refs; r; r = r->next) { - if (r != head && !hashcmp(r->old_sha1, head->old_sha1)) { + if (r != head && + !prefixcmp(r->name, "refs/heads/") && + !hashcmp(r->old_sha1, head->old_sha1)) { *tail = copy_ref(r); tail = &((*tail)->next); if (!all)