Skip to content

Commit 41d910e

Browse files
committed
Merge branch 'hd/show-one-mergetag-fix' into maint
"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.
2 parents 2d7247a + 237a281 commit 41d910e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

log-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ static int show_one_mergetag(struct commit *commit,
515515
"merged tag '%s'\n", tag->tag);
516516
else if ((nth = which_parent(&tag->tagged->oid, commit)) < 0)
517517
strbuf_addf(&verify_message, "tag %s names a non-parent %s\n",
518-
tag->tag, tag->tagged->oid.hash);
518+
tag->tag, oid_to_hex(&tag->tagged->oid));
519519
else
520520
strbuf_addf(&verify_message,
521521
"parent #%d, tagged '%s'\n", nth + 1, tag->tag);

t/t4202-log.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,26 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
16311631
grep "^| | gpg: Good signature" actual
16321632
'
16331633

1634+
test_expect_success GPG 'log --graph --show-signature for merged tag in shallow clone' '
1635+
test_when_finished "git reset --hard && git checkout master" &&
1636+
git checkout -b plain-shallow master &&
1637+
echo aaa >bar &&
1638+
git add bar &&
1639+
git commit -m bar_commit &&
1640+
git checkout --detach master &&
1641+
echo bbb >baz &&
1642+
git add baz &&
1643+
git commit -m baz_commit &&
1644+
git tag -s -m signed_tag_msg signed_tag_shallow &&
1645+
hash=$(git rev-parse HEAD) &&
1646+
git checkout plain-shallow &&
1647+
git merge --no-ff -m msg signed_tag_shallow &&
1648+
git clone --depth 1 --no-local . shallow &&
1649+
test_when_finished "rm -rf shallow" &&
1650+
git -C shallow log --graph --show-signature -n1 plain-shallow >actual &&
1651+
grep "tag signed_tag_shallow names a non-parent $hash" actual
1652+
'
1653+
16341654
test_expect_success GPGSM 'log --graph --show-signature for merged tag x509' '
16351655
test_when_finished "git reset --hard && git checkout master" &&
16361656
test_config gpg.format x509 &&

0 commit comments

Comments
 (0)