fetch: die on invalid --negotiation-tip hash
If a full hexadecimal hash is given as a --negotiation-tip to "git fetch", and that hash does not correspond to an object, "git fetch" will segfault if --negotiate-only is given and will silently ignore that hash otherwise. Make these cases fatal errors, just like the case when an invalid ref name or abbreviated hash is given. While at it, mark the error messages as translatable. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
54a03bc7d9
commit
82823118b9
@ -1428,7 +1428,9 @@ static void add_negotiation_tips(struct git_transport_options *smart_options)
|
||||
if (!has_glob_specials(s)) {
|
||||
struct object_id oid;
|
||||
if (get_oid(s, &oid))
|
||||
die("%s is not a valid object", s);
|
||||
die(_("%s is not a valid object"), s);
|
||||
if (!has_object(the_repository, &oid, 0))
|
||||
die(_("the object %s does not exist"), s);
|
||||
oid_array_append(oids, &oid);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user