(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: { (SQ <'basic update-index tests\n'> <'\n'> <'Tests for command-line parsing and basic operation.\n'> ) } spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'update-index --nonsense fails'>)} { (SQ <'\n'> <'\ttest_must_fail git update-index --nonsense 2>msg &&\n'> <'\tcat msg &&\n'> <'\ttest -s msg\n'> ) } ) (C {<test_expect_success>} {(SQ <'update-index --nonsense dumps usage'>)} { (SQ <'\n'> <'\ttest_expect_code 129 git update-index --nonsense 2>err &&\n'> <'\ttest_i18ngrep "[Uu]sage: git update-index" err\n'> ) } ) (C {<test_expect_success>} {(SQ <'update-index -h with corrupt index'>)} { (SQ <'\n'> <'\tmkdir broken &&\n'> <'\t(\n'> <'\t\tcd broken &&\n'> <'\t\tgit init &&\n'> <'\t\t>.git/index &&\n'> <'\t\ttest_expect_code 129 git update-index -h >usage 2>&1\n'> <'\t) &&\n'> <'\ttest_i18ngrep "[Uu]sage: git update-index" broken/usage\n'> ) } ) (C {<test_expect_success>} {(SQ <'--cacheinfo complains of missing arguments'>)} {(SQ <'\n'> <'\ttest_must_fail git update-index --cacheinfo\n'>)} ) (C {<test_expect_success>} {(SQ <'--cacheinfo does not accept blob null sha1'>)} { (SQ <'\n'> <'\techo content >file &&\n'> <'\tgit add file &&\n'> <'\tgit rev-parse :file >expect &&\n'> <'\ttest_must_fail git update-index --cacheinfo 100644 $_z40 file &&\n'> <'\tgit rev-parse :file >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'--cacheinfo does not accept gitlink null sha1'>)} { (SQ <'\n'> <'\tgit init submodule &&\n'> <'\t(cd submodule && test_commit foo) &&\n'> <'\tgit add submodule &&\n'> <'\tgit rev-parse :submodule >expect &&\n'> <'\ttest_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&\n'> <'\tgit rev-parse :submodule >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'--cacheinfo mode,sha1,path (new syntax)'>)} { (SQ <'\n'> <'\techo content >file &&\n'> <'\tgit hash-object -w --stdin <file >expect &&\n'> <'\n'> <'\tgit update-index --add --cacheinfo 100644 "$(cat expect)" file &&\n'> <'\tgit rev-parse :file >actual &&\n'> <'\ttest_cmp expect actual &&\n'> <'\n'> <'\tgit update-index --add --cacheinfo "100644,$(cat expect),elif" &&\n'> <'\tgit rev-parse :elif >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'.lock files cleaned up'>)} { (SQ <'\n'> <'\tmkdir cleanup &&\n'> <'\t(\n'> <'\tcd cleanup &&\n'> <'\tmkdir worktree &&\n'> <'\tgit init repo &&\n'> <'\tcd repo &&\n'> <'\tgit config core.worktree ../../worktree &&\n'> <'\t# --refresh triggers late setup_work_tree,\n'> <'\t# active_cache_changed is zero, rollback_lock_file fails\n'> <'\tgit update-index --refresh &&\n'> <'\t! test -f .git/index.lock\n'> <'\t)\n'> ) } ) (C {<test_expect_success>} {(SQ <'--chmod=+x and chmod=-x in the same argument list'>)} { (SQ <'\n'> <'\t>A &&\n'> <'\t>B &&\n'> <'\tgit add A B &&\n'> <'\tgit update-index --chmod=+x A --chmod=-x B &&\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\t100755 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tA\n'> <'\t100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0\tB\n'> <'\tEOF\n'> <'\tgit ls-files --stage A B >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_done>}) ] )