3 test_description='basic update-index tests
5 Tests for command-line parsing and basic operation.
10 test_expect_success 'update-index --nonsense fails' '
11 test_must_fail git update-index --nonsense 2>msg &&
16 test_expect_success 'update-index --nonsense dumps usage' '
17 test_expect_code 129 git update-index --nonsense 2>err &&
18 grep "[Uu]sage: git update-index" err
21 test_expect_success 'update-index -h with corrupt index' '
27 test_expect_code 129 git update-index -h >usage 2>&1
29 grep "[Uu]sage: git update-index" broken/usage
32 test_expect_success '--cacheinfo does not accept blob null sha1' '
35 git rev-parse :file >expect &&
36 test_must_fail git update-index --cacheinfo 100644 $_z40 file &&
37 git rev-parse :file >actual &&
38 test_cmp expect actual
41 test_expect_success '--cacheinfo does not accept gitlink null sha1' '
43 (cd submodule && test_commit foo) &&
45 git rev-parse :submodule >expect &&
46 test_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&
47 git rev-parse :submodule >actual &&
48 test_cmp expect actual