interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t1601-index-bogus.sh

23 lines · 523 bytes Raw Blame History
1#!/bin/sh
2
3test_description='test handling of bogus index entries'
4
5. ./test-lib.sh
6
7test_expect_success 'create tree with null sha1' '
8 tree=$(printf "160000 commit $ZERO_OID\\tbroken\\n" | git mktree)
9'
10
11test_expect_success 'read-tree refuses to read null sha1' '
12 test_must_fail git read-tree $tree
13'
14
15test_expect_success 'GIT_ALLOW_NULL_SHA1 overrides refusal' '
16 GIT_ALLOW_NULL_SHA1=1 git read-tree $tree
17'
18
19test_expect_success 'git write-tree refuses to write null sha1' '
20 test_must_fail git write-tree
21'
22
23test_done