summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-02-27 21:58:30 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-02-27 21:58:30 -0800
commitfc7ae9c156775cc9679c0bcc7156abb7dba1bd3a (patch)
tree176d6a941baafd95b6a71e92f4ae2d077e5c6c95 /t
parentMerge branch 'js/detach-doc' (diff)
parentMake hash-object more robust against malformed objects (diff)
downloadtgif-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 dd32432d62..6d52b824b1 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