]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tag: stop using the_repository
authorRené Scharfe <l.s.r@web.de>
Sun, 28 Dec 2025 18:10:51 +0000 (19:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Dec 2025 13:02:54 +0000 (22:02 +0900)
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>
tag.c

diff --git a/tag.c b/tag.c
index 9daeaf2a78ed54b10e237d1d19d729bb784fc620..2f12e51024ec0b717aa70996e473dd63238c8790 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -1,4 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
@@ -58,7 +57,7 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
                return error("%s: cannot verify a non-tag object of type %s.",
                                name_to_report ?
                                name_to_report :
-                               repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV),
+                               oid_to_hex(oid),
                                type_name(type));
 
        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,
                return error("%s: unable to read file.",
                                name_to_report ?
                                name_to_report :
-                               repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV));
+                               oid_to_hex(oid));
 
        ret = run_gpg_verify(buf, size, flags);