Skip to content

Commit e9004de

Browse files
jonathantanmygitster
authored andcommitted
fetch,fetch-pack: clarify connectivity check error
When the connectivity check after a fetch fails, an error message "<remote> did not send all necessary objects" is printed. That error message is printed regardless of the reason of failure: in particular, that message may be printed if the connectivity check fails because a local object is missing. (The connectivity check reads local objects too because it compares the set of objects that the remote claims to send against the set of objects that our refs directly or indirectly reference.) Since it is not necessarily true that the remote did not send all necessary objects, update the error message to be something that more correctly reflects the situation. The updated error message is admittedly vague and one alternative solution would be to update the revision walking code to be able to more precisely specify if a bad object is supposed to be available locally or supposed to have been sent by the remote. That would likely require, in the revision walking code, to delay parsing any object until all its children has been parsed, which seems to be a significant undertaking. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc8c8de commit e9004de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
11331133

11341134
rm = ref_map;
11351135
if (check_connected(iterate_ref_map, &rm, &opt)) {
1136-
rc = error(_("%s did not send all necessary objects\n"), url);
1136+
rc = error(_("connectivity check failed after fetching from %s\n"), url);
11371137
goto abort;
11381138
}
11391139
}

fetch-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
20032003
if (args->deepen)
20042004
opt.is_deepening_fetch = 1;
20052005
if (check_connected(iterate_ref_map, &iterator, &opt)) {
2006-
error(_("remote did not send all necessary objects"));
2006+
error(_("connectivity check failed after fetching from remote"));
20072007
free_refs(ref_cpy);
20082008
ref_cpy = NULL;
20092009
rollback_shallow_file(the_repository, &shallow_lock);

0 commit comments

Comments
 (0)