blame, line-log: do not loop around deref_tag()
These callers appear to expect that deref_tag() is to peel one layer of a tag, but the function does not work that way; it has its own loop to unwrap tags until an object that is not a tag appears. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 14, 2016 at 13:38 UTC
31da121f2d316575ec3c82dfc0c7442cdb7a7740
2 files changed
+3
-6
builtin/blame.c
+2
-4
@@ -2400,8 +2400,7 @@ static char *prepare_final(struct scoreboard *sb)
2400
struct object *obj = revs->pending.objects[i].item;
2401
if (obj->flags & UNINTERESTING)
2402
continue;
2403
- while (obj->type == OBJ_TAG)
2404
- obj = deref_tag(obj, NULL, 0);
2403
+ obj = deref_tag(obj, NULL, 0);
2404
if (obj->type != OBJ_COMMIT)
2405
die("Non commit %s?", revs->pending.objects[i].name);
2406
if (sb->final)
@@ -2428,8 +2427,7 @@ static char *prepare_initial(struct scoreboard *sb)
2427
struct object *obj = revs->pending.objects[i].item;
2428
if (!(obj->flags & UNINTERESTING))
2429
continue;
2431
- while (obj->type == OBJ_TAG)
2432
- obj = deref_tag(obj, NULL, 0);
2430
+ obj = deref_tag(obj, NULL, 0);
2431
if (obj->type != OBJ_COMMIT)
2432
die("Non commit %s?", revs->pending.objects[i].name);
2433
if (sb->final)
line-log.c
+1
-2
@@ -479,8 +479,7 @@ static struct commit *check_single_commit(struct rev_info *revs)
479
struct object *obj = revs->pending.objects[i].item;
480
if (obj->flags & UNINTERESTING)
481
continue;
482
- while (obj->type == OBJ_TAG)
483
- obj = deref_tag(obj, NULL, 0);
482
+ obj = deref_tag(obj, NULL, 0);
483
if (obj->type != OBJ_COMMIT)
484
die("Non commit %s?", revs->pending.objects[i].name);
485
if (commit)