summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-04-13 15:28:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-04-13 15:28:50 -0700
commitf63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b (patch)
tree438da5de939da18d89f81e84f9ea55e4f8957981 /t
parentThe eighth batch (diff)
parentref-filter: fix NULL check for parse object failure (diff)
downloadtgif-f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b.tar.xz
Merge branch 'jk/ref-filter-segfault-fix'
A NULL-dereference bug has been corrected in an error codepath in "git for-each-ref", "git branch --list" etc. * jk/ref-filter-segfault-fix: ref-filter: fix NULL check for parse object failure
Diffstat (limited to 't')
-rwxr-xr-xt/t6300-for-each-ref.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index cac7f443d0..2e7c32d50c 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -1134,4 +1134,14 @@ test_expect_success 'for-each-ref --ignore-case works on multiple sort keys' '
test_cmp expect actual
'
+test_expect_success 'for-each-ref reports broken tags' '
+ git tag -m "good tag" broken-tag-good HEAD &&
+ git cat-file tag broken-tag-good >good &&
+ sed s/commit/blob/ <good >bad &&
+ bad=$(git hash-object -w -t tag bad) &&
+ git update-ref refs/tags/broken-tag-bad $bad &&
+ test_must_fail git for-each-ref --format="%(*objectname)" \
+ refs/tags/broken-tag-*
+'
+
test_done