summaryrefslogtreecommitdiff
path: root/ls-refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ls-refs.c')
-rw-r--r--ls-refs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ls-refs.c b/ls-refs.c
index 818aef70a0..50d86866c6 100644
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -93,7 +93,7 @@ int ls_refs(struct repository *r, struct argv_array *keys,
git_config(ls_refs_config, NULL);
- while (packet_reader_read(request) != PACKET_READ_FLUSH) {
+ while (packet_reader_read(request) == PACKET_READ_NORMAL) {
const char *arg = request->line;
const char *out;
@@ -105,6 +105,9 @@ int ls_refs(struct repository *r, struct argv_array *keys,
argv_array_push(&data.prefixes, out);
}
+ if (request->status != PACKET_READ_FLUSH)
+ die(_("expected flush after ls-refs arguments"));
+
head_ref_namespaced(send_ref, &data);
for_each_namespaced_ref(send_ref, &data);
packet_flush(1);