diff --git a/remote.c b/remote.c
index ca42a126ad04514f0ed8378768ebce98cfc5a659..b8ecfa5d9558e3824872ad6778fc344681cc8d5c 100644 (file)
--- a/remote.c
+++ b/remote.c
return alloc_ref_with_prefix("", 0, 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;
{
struct ref *cpy;
size_t len;
/* Look for another ref that points there */
for (r = refs; r; r = r->next) {
/* 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)
*tail = copy_ref(r);
tail = &((*tail)->next);
if (!all)