summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-10 18:32:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-10 18:32:39 (GMT)
commitf8c2e3f67133e82b1df9c4cc806ba5d67670e425 (patch)
tree390e58157ae4392d7bb2bfc478cd2fc929bc7400
parentc4bccea2d52dd59e0e6200cebba3df2dfcf593ea (diff)
parent5e1361ccdbfaf328b5bae1eae29f16ba965c54b1 (diff)
downloadgit-f8c2e3f67133e82b1df9c4cc806ba5d67670e425.zip
git-f8c2e3f67133e82b1df9c4cc806ba5d67670e425.tar.gz
git-f8c2e3f67133e82b1df9c4cc806ba5d67670e425.tar.bz2
Merge branch 'bc/log-decoration'
"git log --decorate" did not handle a tag pointed by another tag nicely. * bc/log-decoration: log: properly handle decorations with chained tags
-rw-r--r--log-tree.c2
-rwxr-xr-xt/t4205-log-pretty-formats.sh15
2 files changed, 17 insertions, 0 deletions
diff --git a/log-tree.c b/log-tree.c
index 642faff..08970bf 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -134,6 +134,8 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
obj = ((struct tag *)obj)->tagged;
if (!obj)
break;
+ if (!obj->parsed)
+ parse_object(obj->sha1);
add_name_decoration(DECORATION_REF_TAG, refname, obj);
}
return 0;
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index fb00041..2a6278b 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -310,4 +310,19 @@ EOF
test_cmp expected actual
'
+test_expect_success 'log decoration properly follows tag chain' '
+ git tag -a tag1 -m tag1 &&
+ git tag -a tag2 -m tag2 tag1 &&
+ git tag -d tag1 &&
+ git commit --amend -m shorter &&
+ git log --no-walk --tags --pretty="%H %d" --decorate=full >actual &&
+ cat <<EOF >expected &&
+6a908c10688b2503073c39c9ba26322c73902bb5 (tag: refs/tags/tag2)
+9f716384d92283fb915a4eee5073f030638e05f9 (tag: refs/tags/message-one)
+b87e4cccdb77336ea79d89224737be7ea8e95367 (tag: refs/tags/message-two)
+EOF
+ sort actual >actual1 &&
+ test_cmp expected actual1
+'
+
test_done