summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
Diffstat (limited to 'refs')
-rw-r--r--refs/debug.c3
-rw-r--r--refs/packed-backend.c4
-rw-r--r--refs/ref-cache.c2
-rw-r--r--refs/refs-internal.h3
4 files changed, 8 insertions, 4 deletions
diff --git a/refs/debug.c b/refs/debug.c
index 7db4abccc3..1a7a9e11cf 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -232,7 +232,8 @@ debug_ref_iterator_begin(struct ref_store *ref_store, const char *prefix,
struct debug_ref_iterator *diter = xcalloc(1, sizeof(*diter));
base_ref_iterator_init(&diter->base, &debug_ref_iterator_vtable, 1);
diter->iter = res;
- trace_printf_key(&trace_refs, "ref_iterator_begin: %s (0x%x)\n", prefix, flags);
+ trace_printf_key(&trace_refs, "ref_iterator_begin: \"%s\" (0x%x)\n",
+ prefix, flags);
return &diter->base;
}
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index dfecdbc1db..f8aa97d799 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -889,7 +889,7 @@ static int packed_ref_iterator_peel(struct ref_iterator *ref_iterator,
} else if ((iter->base.flags & (REF_ISBROKEN | REF_ISSYMREF))) {
return -1;
} else {
- return !!peel_object(&iter->oid, peeled);
+ return peel_object(&iter->oid, peeled) ? -1 : 0;
}
}
@@ -1425,7 +1425,7 @@ static int packed_transaction_prepare(struct ref_store *ref_store,
*/
CALLOC_ARRAY(data, 1);
- string_list_init(&data->updates, 0);
+ string_list_init_nodup(&data->updates);
transaction->backend_data = data;
diff --git a/refs/ref-cache.c b/refs/ref-cache.c
index 46f1e54284..49d732f6db 100644
--- a/refs/ref-cache.c
+++ b/refs/ref-cache.c
@@ -491,7 +491,7 @@ static int cache_ref_iterator_advance(struct ref_iterator *ref_iterator)
static int cache_ref_iterator_peel(struct ref_iterator *ref_iterator,
struct object_id *peeled)
{
- return peel_object(ref_iterator->oid, peeled);
+ return peel_object(ref_iterator->oid, peeled) ? -1 : 0;
}
static int cache_ref_iterator_abort(struct ref_iterator *ref_iterator)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 467f4b3c93..3155708345 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -453,6 +453,9 @@ void base_ref_iterator_free(struct ref_iterator *iter);
*/
typedef int ref_iterator_advance_fn(struct ref_iterator *ref_iterator);
+/*
+ * Peels the current ref, returning 0 for success or -1 for failure.
+ */
typedef int ref_iterator_peel_fn(struct ref_iterator *ref_iterator,
struct object_id *peeled);