tag: stop using the_repository

gpg_verify_tag() shows the passed in object name on error. Both callers provide one. It falls back to abbreviated hashes for future callers that pass in a NULL name. DEFAULT_ABBREV is default_abbrev, which in turn is a global variable that's populated by git_default_config() and only available with USE_THE_REPOSITORY_VARIABLE. Don't let that hypothetical hold us back from getting rid of the_repository in tag.c. Fall back to full hashes, which are more appropriate for error messages anyway. This allows us to stop setting USE_THE_REPOSITORY_VARIABLE. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Dec 28, 2025 at 19:10 UTC 009fceeda26e12e2dbacd04eef47c62d4e206403
1 file changed +2 -3
tag.c
+2 -3
@@ -1,4 +1,3 @@
1 -#define USE_THE_REPOSITORY_VARIABLE
1 #define DISABLE_SIGN_COMPARE_WARNINGS
2
3 #include "git-compat-util.h"
@@ -58,7 +57,7 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
57 return error("%s: cannot verify a non-tag object of type %s.",
58 name_to_report ?
59 name_to_report :
61 - repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV),
60 + oid_to_hex(oid),
61 type_name(type));
62
63 buf = odb_read_object(r->objects, oid, &type, &size);
@@ -66,7 +65,7 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
65 return error("%s: unable to read file.",
66 name_to_report ?
67 name_to_report :
69 - repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV));
68 + oid_to_hex(oid));
69
70 ret = run_gpg_verify(buf, size, flags);
71