aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:30 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:30 -0800
commitfc7ae9c156775cc9679c0bcc7156abb7dba1bd3a (patch)
tree176d6a941baafd95b6a71e92f4ae2d077e5c6c95 /t
parent99f45c2a5db46c1397a80b0ab282456006b40cb1 (diff)
parentc879daa23729547fb28aa7e8783c5e4e619a9e7c (diff)
downloadgit-fc7ae9c156775cc9679c0bcc7156abb7dba1bd3a.tar.gz
git-fc7ae9c156775cc9679c0bcc7156abb7dba1bd3a.tar.xz
Merge branch 'nd/hash-object-sanity'
* nd/hash-object-sanity: Make hash-object more robust against malformed objects Conflicts: cache.h
Diffstat (limited to 't')
-rwxr-xr-xt/t1007-hash-object.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index dd32432d6..6d52b824b 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -188,4 +188,17 @@ for args in "-w --stdin-paths" "--stdin-paths -w"; do
pop_repo
done
+test_expect_success 'corrupt tree' '
+ echo abc >malformed-tree
+ test_must_fail git hash-object -t tree malformed-tree
+'
+
+test_expect_success 'corrupt commit' '
+ test_must_fail git hash-object -t commit --stdin </dev/null
+'
+
+test_expect_success 'corrupt tag' '
+ test_must_fail git hash-object -t tag --stdin </dev/null
+'
+
test_done