Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-09-05 22:59:42 +0300
committerJunio C Hamano <gitster@pobox.com>2019-09-06 00:11:34 +0300
commitc77722b3ea42a87381915f1203648a5f5d86c1ff (patch)
tree44b3e742d69e5e3334b5865ae1237cc9c045f258 /builtin/replace.c
parentdad3f0607bf1c864f80723ab20b39527260f2c4f (diff)
use get_tagged_oid()
Avoid derefencing ->tagged without checking for NULL by using the convenience wrapper for getting the ID of the tagged object. It die()s when encountering a broken tag instead of segfaulting. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/replace.c')
-rw-r--r--builtin/replace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/replace.c b/builtin/replace.c
index 644b21ca8d..2a4afb3b93 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -421,7 +421,7 @@ static int check_one_mergetag(struct commit *commit,
if (get_oid(mergetag_data->argv[i], &oid) < 0)
return error(_("not a valid object name: '%s'"),
mergetag_data->argv[i]);
- if (oideq(&tag->tagged->oid, &oid))
+ if (oideq(get_tagged_oid(tag), &oid))
return 0; /* found */
}