зеркало из https://github.com/microsoft/git.git
Merge branch 'hn/refs-iterator-peel-returns-boolean'
Tiny API tweak. * hn/refs-iterator-peel-returns-boolean: refs: make explicit that ref_iterator_peel returns boolean
This commit is contained in:
Коммит
f0ade787ac
2
refs.c
2
refs.c
|
@ -2010,7 +2010,7 @@ int peel_iterated_oid(const struct object_id *base, struct object_id *peeled)
|
|||
oideq(current_ref_iter->oid, base)))
|
||||
return ref_iterator_peel(current_ref_iter, peeled);
|
||||
|
||||
return peel_object(base, peeled);
|
||||
return peel_object(base, peeled) ? -1 : 0;
|
||||
}
|
||||
|
||||
int refs_create_symref(struct ref_store *refs,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче