promisor-remote: remove a return value

No caller of promisor_remote_get_direct() is checking its return value, so remove it. Not checking the return value means that the user would not know whether the failure of reading an object is due to the promisor remote not supplying the object or because of local repository corruption, but this will be fixed in a subsequent patch. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Oct 4, 2022 at 14:13 UTC 00057bf14c9269cb26a6b8ba7e8bc9ecd634d22c
2 files changed +9 -14
promisor-remote.c
+4 -8
@@ -230,18 +230,17 @@ static int remove_fetched_oids(struct repository *repo,
230 return remaining_nr;
231 }
232
233 -int promisor_remote_get_direct(struct repository *repo,
234 - const struct object_id *oids,
235 - int oid_nr)
233 +void promisor_remote_get_direct(struct repository *repo,
234 + const struct object_id *oids,
235 + int oid_nr)
236 {
237 struct promisor_remote *r;
238 struct object_id *remaining_oids = (struct object_id *)oids;
239 int remaining_nr = oid_nr;
240 int to_free = 0;
241 - int res = -1;
241
242 if (oid_nr == 0)
244 - return 0;
243 + return;
244
245 promisor_remote_init(repo);
246
@@ -256,12 +255,9 @@ int promisor_remote_get_direct(struct repository *repo,
255 continue;
256 }
257 }
259 - res = 0;
258 break;
259 }
260
261 if (to_free)
262 free(remaining_oids);
265 -
266 - return res;
263 }
promisor-remote.h
+5 -6
@@ -39,13 +39,12 @@ static inline int has_promisor_remote(void)
39
40 /*
41 * Fetches all requested objects from all promisor remotes, trying them one at
42 - * a time until all objects are fetched. Returns 0 upon success, and non-zero
43 - * otherwise.
42 + * a time until all objects are fetched.
43 *
45 - * If oid_nr is 0, this function returns 0 (success) immediately.
44 + * If oid_nr is 0, this function returns immediately.
45 */
47 -int promisor_remote_get_direct(struct repository *repo,
48 - const struct object_id *oids,
49 - int oid_nr);
46 +void promisor_remote_get_direct(struct repository *repo,
47 + const struct object_id *oids,
48 + int oid_nr);
49
50 #endif /* PROMISOR_REMOTE_H */