summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-09 11:21:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-09 11:21:21 -0700
commit3658d77f8e563e77658d9e44df5e24f08ca99e3a (patch)
tree70c8cd2800aedabf607827d6b4f87a66d0fa6133
parentMerge branch 'rt/format-zero-length-fix' (diff)
parentshow_one_mergetag: print non-parent in hex form. (diff)
downloadtgif-3658d77f8e563e77658d9e44df5e24f08ca99e3a.tar.xz
Merge branch 'hd/show-one-mergetag-fix'
"git show" and others gave an object name in raw format in its error output, which has been corrected to give it in hex. * hd/show-one-mergetag-fix: show_one_mergetag: print non-parent in hex form.
-rw-r--r--log-tree.c2
-rwxr-xr-xt/t4202-log.sh20
2 files changed, 21 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c
index 5425ae931f..52127427ff 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -516,7 +516,7 @@ static int show_one_mergetag(struct commit *commit,
"merged tag '%s'\n", tag->tag);
else if ((nth = which_parent(&tag->tagged->oid, commit)) < 0)
strbuf_addf(&verify_message, "tag %s names a non-parent %s\n",
- tag->tag, tag->tagged->oid.hash);
+ tag->tag, oid_to_hex(&tag->tagged->oid));
else
strbuf_addf(&verify_message,
"parent #%d, tagged '%s'\n", nth + 1, tag->tag);
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 4694b6d0ce..0f766ba65f 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1607,6 +1607,26 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
grep "^| | gpg: Good signature" actual
'
+test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
+ test_when_finished "git reset --hard && git checkout master" &&
+ git checkout -b plain-shallow master &&
+ echo aaa >bar &&
+ git add bar &&
+ git commit -m bar_commit &&
+ git checkout --detach master &&
+ echo bbb >baz &&
+ git add baz &&
+ git commit -m baz_commit &&
+ git tag -s -m signed_tag_msg signed_tag_shallow &&
+ hash=$(git rev-parse HEAD) &&
+ git checkout plain-shallow &&
+ git merge --no-ff -m msg signed_tag_shallow &&
+ git clone --depth 1 --no-local . shallow &&
+ test_when_finished "rm -rf shallow" &&
+ git -C shallow log --graph --show-signature -n1 plain-shallow >actual &&
+ grep "tag signed_tag_shallow names a non-parent $hash" actual
+'
+
test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
test_when_finished "git reset --hard && git checkout master" &&
test_config gpg.format x509 &&