Skip to content

Commit 00057bf

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0feb86 commit 00057bf

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

promisor-remote.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,17 @@ static int remove_fetched_oids(struct repository *repo,
230230
return remaining_nr;
231231
}
232232

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)
236236
{
237237
struct promisor_remote *r;
238238
struct object_id *remaining_oids = (struct object_id *)oids;
239239
int remaining_nr = oid_nr;
240240
int to_free = 0;
241-
int res = -1;
242241

243242
if (oid_nr == 0)
244-
return 0;
243+
return;
245244

246245
promisor_remote_init(repo);
247246

@@ -256,12 +255,9 @@ int promisor_remote_get_direct(struct repository *repo,
256255
continue;
257256
}
258257
}
259-
res = 0;
260258
break;
261259
}
262260

263261
if (to_free)
264262
free(remaining_oids);
265-
266-
return res;
267263
}

promisor-remote.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ static inline int has_promisor_remote(void)
3939

4040
/*
4141
* 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.
4443
*
45-
* If oid_nr is 0, this function returns 0 (success) immediately.
44+
* If oid_nr is 0, this function returns immediately.
4645
*/
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);
5049

5150
#endif /* PROMISOR_REMOTE_H */

0 commit comments

Comments
 (0)