[PATCH 01/16] foreach_alt_odb: propagate return value from callback

2014-10-03 Thread Jeff King
We check the return value of the callback and stop iterating if it is non-zero. However, we do not make the non-zero return value available to the caller, so they have no way of knowing whether the operation succeeded or not (technically they can keep their own error flag in the callback data, but

Re: [PATCH 01/16] foreach_alt_odb: propagate return value from callback

2014-10-03 Thread René Scharfe
Am 03.10.2014 um 22:21 schrieb Jeff King: We check the return value of the callback and stop iterating if it is non-zero. However, we do not make the non-zero return value available to the caller, so they have no way of knowing whether the operation succeeded or not (technically they can keep

Re: [PATCH 01/16] foreach_alt_odb: propagate return value from callback

2014-10-03 Thread Jeff King
On Sat, Oct 04, 2014 at 12:55:13AM +0200, René Scharfe wrote: -void foreach_alt_odb(alt_odb_fn fn, void *cb) +int foreach_alt_odb(alt_odb_fn fn, void *cb) { struct alternate_object_database *ent; +int r = 0; prepare_alt_odb(); -for (ent = alt_odb_list; ent; ent =