зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
a0feb8611d
Коммит
00057bf14c
|
@ -230,7 +230,7 @@ static int remove_fetched_oids(struct repository *repo,
|
||||||
return remaining_nr;
|
return remaining_nr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int promisor_remote_get_direct(struct repository *repo,
|
void promisor_remote_get_direct(struct repository *repo,
|
||||||
const struct object_id *oids,
|
const struct object_id *oids,
|
||||||
int oid_nr)
|
int oid_nr)
|
||||||
{
|
{
|
||||||
|
@ -238,10 +238,9 @@ int promisor_remote_get_direct(struct repository *repo,
|
||||||
struct object_id *remaining_oids = (struct object_id *)oids;
|
struct object_id *remaining_oids = (struct object_id *)oids;
|
||||||
int remaining_nr = oid_nr;
|
int remaining_nr = oid_nr;
|
||||||
int to_free = 0;
|
int to_free = 0;
|
||||||
int res = -1;
|
|
||||||
|
|
||||||
if (oid_nr == 0)
|
if (oid_nr == 0)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
promisor_remote_init(repo);
|
promisor_remote_init(repo);
|
||||||
|
|
||||||
|
@ -256,12 +255,9 @@ int promisor_remote_get_direct(struct repository *repo,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to_free)
|
if (to_free)
|
||||||
free(remaining_oids);
|
free(remaining_oids);
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,12 +39,11 @@ static inline int has_promisor_remote(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fetches all requested objects from all promisor remotes, trying them one at
|
* Fetches all requested objects from all promisor remotes, trying them one at
|
||||||
* a time until all objects are fetched. Returns 0 upon success, and non-zero
|
* a time until all objects are fetched.
|
||||||
* otherwise.
|
|
||||||
*
|
*
|
||||||
* If oid_nr is 0, this function returns 0 (success) immediately.
|
* If oid_nr is 0, this function returns immediately.
|
||||||
*/
|
*/
|
||||||
int promisor_remote_get_direct(struct repository *repo,
|
void promisor_remote_get_direct(struct repository *repo,
|
||||||
const struct object_id *oids,
|
const struct object_id *oids,
|
||||||
int oid_nr);
|
int oid_nr);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче