Skip to content

Commit 009fcee

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6e4cc8 commit 009fcee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tag.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#define USE_THE_REPOSITORY_VARIABLE
21
#define DISABLE_SIGN_COMPARE_WARNINGS
32

43
#include "git-compat-util.h"
@@ -58,15 +57,15 @@ int gpg_verify_tag(struct repository *r, const struct object_id *oid,
5857
return error("%s: cannot verify a non-tag object of type %s.",
5958
name_to_report ?
6059
name_to_report :
61-
repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV),
60+
oid_to_hex(oid),
6261
type_name(type));
6362

6463
buf = odb_read_object(r->objects, oid, &type, &size);
6564
if (!buf)
6665
return error("%s: unable to read file.",
6766
name_to_report ?
6867
name_to_report :
69-
repo_find_unique_abbrev(r, oid, DEFAULT_ABBREV));
68+
oid_to_hex(oid));
7069

7170
ret = run_gpg_verify(buf, size, flags);
7271

0 commit comments

Comments
 (0)