diff options
| author | Junio C Hamano <gitster@pobox.com> | 2012-08-27 11:54:28 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2012-08-27 11:54:28 -0700 |
| commit | 3b753148b636be9dc821feebf85cd7f1739b07a1 (patch) | |
| tree | e8b95caaf57039b797a844f429806df177a1bde4 /t/t2107-update-index-basic.sh | |
| parent | Merge branch 'mm/push-default-switch-warning' (diff) | |
| parent | fsck: detect null sha1 in tree entries (diff) | |
| download | git-3b753148b636be9dc821feebf85cd7f1739b07a1.tar.gz git-3b753148b636be9dc821feebf85cd7f1739b07a1.zip | |
Merge branch 'jk/maint-null-in-trees'
We do not want a link to 0{40} object stored anywhere in our objects.
* jk/maint-null-in-trees:
fsck: detect null sha1 in tree entries
do not write null sha1s to on-disk index
diff: do not use null sha1 as a sentinel value
Diffstat (limited to 't/t2107-update-index-basic.sh')
| -rwxr-xr-x | t/t2107-update-index-basic.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh index 809fafe208..0dbbb00d74 100755 --- a/t/t2107-update-index-basic.sh +++ b/t/t2107-update-index-basic.sh @@ -29,4 +29,23 @@ test_expect_success 'update-index -h with corrupt index' ' grep "[Uu]sage: git update-index" broken/usage ' +test_expect_success '--cacheinfo does not accept blob null sha1' ' + echo content >file && + git add file && + git rev-parse :file >expect && + test_must_fail git update-index --cacheinfo 100644 $_z40 file && + git rev-parse :file >actual && + test_cmp expect actual +' + +test_expect_success '--cacheinfo does not accept gitlink null sha1' ' + git init submodule && + (cd submodule && test_commit foo) && + git add submodule && + git rev-parse :submodule >expect && + test_must_fail git update-index --cacheinfo 160000 $_z40 submodule && + git rev-parse :submodule >actual && + test_cmp expect actual +' + test_done |
