(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: { (SQ (Token id:Id.Lit_Chars val:'basic update-index tests\n' span_id:6) (Token id:Id.Lit_Chars val:'\n' span_id:7) (Token id:Id.Lit_Chars val:'Tests for command-line parsing and basic operation.\n' span_id:8) ) } spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'update-index --nonsense fails' span_id:20))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:24) (Token id: Id.Lit_Chars val: '\ttest_must_fail git update-index --nonsense 2>msg &&\n' span_id: 25 ) (Token id:Id.Lit_Chars val:'\tcat msg &&\n' span_id:26) (Token id:Id.Lit_Chars val:'\ttest -s msg\n' span_id:27) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'update-index --nonsense dumps usage' span_id:34))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:38) (Token id: Id.Lit_Chars val: '\ttest_expect_code 129 git update-index --nonsense 2>err &&\n' span_id: 39 ) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "[Uu]sage: git update-index" err\n' span_id:40) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'update-index -h with corrupt index' span_id:47))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:51) (Token id:Id.Lit_Chars val:'\tmkdir broken &&\n' span_id:52) (Token id:Id.Lit_Chars val:'\t(\n' span_id:53) (Token id:Id.Lit_Chars val:'\t\tcd broken &&\n' span_id:54) (Token id:Id.Lit_Chars val:'\t\tgit init &&\n' span_id:55) (Token id:Id.Lit_Chars val:'\t\t>.git/index &&\n' span_id:56) (Token id:Id.Lit_Chars val:'\t\ttest_expect_code 129 git update-index -h >usage 2>&1\n' span_id:57) (Token id:Id.Lit_Chars val:'\t) &&\n' span_id:58) (Token id:Id.Lit_Chars val:'\ttest_i18ngrep "[Uu]sage: git update-index" broken/usage\n' span_id:59) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--cacheinfo complains of missing arguments' span_id:66))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:70) (Token id: Id.Lit_Chars val: '\ttest_must_fail git update-index --cacheinfo\n' span_id: 71 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--cacheinfo does not accept blob null sha1' span_id:78))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:82) (Token id:Id.Lit_Chars val:'\techo content >file &&\n' span_id:83) (Token id:Id.Lit_Chars val:'\tgit add file &&\n' span_id:84) (Token id:Id.Lit_Chars val:'\tgit rev-parse :file >expect &&\n' span_id:85) (Token id: Id.Lit_Chars val: '\ttest_must_fail git update-index --cacheinfo 100644 $_z40 file &&\n' span_id: 86 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse :file >actual &&\n' span_id:87) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:88) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--cacheinfo does not accept gitlink null sha1' span_id:95))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:99) (Token id:Id.Lit_Chars val:'\tgit init submodule &&\n' span_id:100) (Token id:Id.Lit_Chars val:'\t(cd submodule && test_commit foo) &&\n' span_id:101) (Token id:Id.Lit_Chars val:'\tgit add submodule &&\n' span_id:102) (Token id:Id.Lit_Chars val:'\tgit rev-parse :submodule >expect &&\n' span_id:103) (Token id: Id.Lit_Chars val: '\ttest_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&\n' span_id: 104 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse :submodule >actual &&\n' span_id:105) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:106) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--cacheinfo mode,sha1,path (new syntax)' span_id:113))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:117) (Token id:Id.Lit_Chars val:'\techo content >file &&\n' span_id:118) (Token id:Id.Lit_Chars val:'\tgit hash-object -w --stdin <file >expect &&\n' span_id:119) (Token id:Id.Lit_Chars val:'\n' span_id:120) (Token id: Id.Lit_Chars val: '\tgit update-index --add --cacheinfo 100644 "$(cat expect)" file &&\n' span_id: 121 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse :file >actual &&\n' span_id:122) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:123) (Token id:Id.Lit_Chars val:'\n' span_id:124) (Token id: Id.Lit_Chars val: '\tgit update-index --add --cacheinfo "100644,$(cat expect),elif" &&\n' span_id: 125 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse :elif >actual &&\n' span_id:126) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:127) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'.lock files cleaned up' span_id:134))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:138) (Token id:Id.Lit_Chars val:'\tmkdir cleanup &&\n' span_id:139) (Token id:Id.Lit_Chars val:'\t(\n' span_id:140) (Token id:Id.Lit_Chars val:'\tcd cleanup &&\n' span_id:141) (Token id:Id.Lit_Chars val:'\tmkdir worktree &&\n' span_id:142) (Token id:Id.Lit_Chars val:'\tgit init repo &&\n' span_id:143) (Token id:Id.Lit_Chars val:'\tcd repo &&\n' span_id:144) (Token id: Id.Lit_Chars val: '\tgit config core.worktree ../../worktree &&\n' span_id: 145 ) (Token id:Id.Lit_Chars val:'\t# --refresh triggers late setup_work_tree,\n' span_id:146) (Token id: Id.Lit_Chars val: '\t# active_cache_changed is zero, rollback_lock_file fails\n' span_id: 147 ) (Token id:Id.Lit_Chars val:'\tgit update-index --refresh &&\n' span_id:148) (Token id:Id.Lit_Chars val:'\t! test -f .git/index.lock\n' span_id:149) (Token id:Id.Lit_Chars val:'\t)\n' span_id:150) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '--chmod=+x and chmod=-x in the same argument list' span_id: 157 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:161) (Token id:Id.Lit_Chars val:'\t>A &&\n' span_id:162) (Token id:Id.Lit_Chars val:'\t>B &&\n' span_id:163) (Token id:Id.Lit_Chars val:'\tgit add A B &&\n' span_id:164) (Token id:Id.Lit_Chars val:'\tgit update-index --chmod=+x A --chmod=-x B &&\n' span_id:165) (Token id:Id.Lit_Chars val:'\tcat >expect <<-\\EOF &&\n' span_id:166) (Token id:Id.Lit_Chars val:'\t100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tA\n' span_id:167) (Token id: Id.Lit_Chars val: '\t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tB\n' span_id: 168 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:169) (Token id:Id.Lit_Chars val:'\tgit ls-files --stage A B >actual &&\n' span_id:170) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:171) ) } ) (C {(test_done)}) ] )