mirror of
https://github.com/git/git.git
synced 2024-12-01 05:54:16 +08: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>
23 lines
522 B
Bash
Executable File
23 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
|