mirror of
https://github.com/git/git.git
synced 2024-10-31 22:37:54 +01:00
8125a58b91
Switch all uses of $_z40 to $ZERO_OID so that they work correctly with larger hashes. This commit was created by using the following sed command to modify all files in the t directory except t/test-lib.sh: sed -i 's/\$_z40/$ZERO_OID/g' Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 lines
522 B
Bash
Executable file
22 lines
522 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='test handling of bogus index entries'
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success 'create tree with null sha1' '
|
|
tree=$(printf "160000 commit $ZERO_OID\\tbroken\\n" | git mktree)
|
|
'
|
|
|
|
test_expect_success 'read-tree refuses to read null sha1' '
|
|
test_must_fail git read-tree $tree
|
|
'
|
|
|
|
test_expect_success 'GIT_ALLOW_NULL_SHA1 overrides refusal' '
|
|
GIT_ALLOW_NULL_SHA1=1 git read-tree $tree
|
|
'
|
|
|
|
test_expect_success 'git write-tree refuses to write null sha1' '
|
|
test_must_fail git write-tree
|
|
'
|
|
|
|
test_done
|