summaryrefslogtreecommitdiff
path: root/t/t6301-for-each-ref-errors.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-06-03 13:51:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-08 17:35:41 (GMT)
commit501cf47cddfbf8040b6f9b8ac06d13094a70f729 (patch)
tree64d8e2187d0dc508da8b916a205b8cfe6d893418 /t/t6301-for-each-ref-errors.sh
parentf5517074f8f5cecc773b2ff927be4a059f2c9db0 (diff)
downloadgit-501cf47cddfbf8040b6f9b8ac06d13094a70f729.zip
git-501cf47cddfbf8040b6f9b8ac06d13094a70f729.tar.gz
git-501cf47cddfbf8040b6f9b8ac06d13094a70f729.tar.bz2
read_loose_refs(): treat NULL_SHA1 loose references as broken
NULL_SHA1 is used to indicate an "invalid object name" throughout our code (and the code of other git implementations), so it is vastly more likely that an on-disk reference was set to this value due to a software bug than that NULL_SHA1 is the legitimate SHA-1 of an actual object. Therefore, if a loose reference has the value NULL_SHA1, consider it to be broken. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6301-for-each-ref-errors.sh')
-rwxr-xr-xt/t6301-for-each-ref-errors.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh
index 72d2397..cdb67a0 100755
--- a/t/t6301-for-each-ref-errors.sh
+++ b/t/t6301-for-each-ref-errors.sh
@@ -24,7 +24,7 @@ test_expect_success 'Broken refs are reported correctly' '
test_cmp broken-err err
'
-test_expect_failure 'NULL_SHA1 refs are reported correctly' '
+test_expect_success 'NULL_SHA1 refs are reported correctly' '
r=refs/heads/zeros &&
echo $ZEROS >.git/$r &&
test_when_finished "rm -f .git/$r" &&