summaryrefslogtreecommitdiff
path: root/ls-refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ls-refs.c')
-rw-r--r--ls-refs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ls-refs.c b/ls-refs.c
index 32deb7be44..88f6c3f60d 100644
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -100,7 +100,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
if (data->peel && oid) {
struct object_id peeled;
- if (!peel_ref(refname, &peeled))
+ if (!peel_iterated_oid(oid, &peeled))
strbuf_addf(&refline, " peeled:%s", oid_to_hex(&peeled));
}
@@ -144,6 +144,7 @@ int ls_refs(struct repository *r, struct strvec *keys,
struct ls_refs_data data;
memset(&data, 0, sizeof(data));
+ strvec_init(&data.prefixes);
ensure_config_read();
git_config(ls_refs_config, NULL);
@@ -166,7 +167,10 @@ int ls_refs(struct repository *r, struct strvec *keys,
die(_("expected flush after ls-refs arguments"));
send_possibly_unborn_head(&data);
- for_each_namespaced_ref(send_ref, &data);
+ if (!data.prefixes.nr)
+ strvec_push(&data.prefixes, "");
+ for_each_fullref_in_prefixes(get_git_namespace(), data.prefixes.v,
+ send_ref, &data, 0);
packet_flush(1);
strvec_clear(&data.prefixes);
return 0;