(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'check quarantine of objects during push'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <'create picky dest repo'>)} { (SQ <'\n'> <'\tgit init --bare dest.git &&\n'> <'\twrite_script dest.git/hooks/pre-receive <<-\\EOF\n'> <'\twhile read old new ref; do\n'> <'\t\ttest "$(git log -1 --format=%s $new)" = reject && exit 1\n'> <'\tdone\n'> <'\texit 0\n'> <'\tEOF\n'> ) } ) (C {(test_expect_success)} {(SQ <'accepted objects work'>)} { (SQ <'\n'> <'\ttest_commit ok &&\n'> <'\tgit push dest.git HEAD &&\n'> <'\tcommit=$(git rev-parse HEAD) &&\n'> <'\tgit --git-dir=dest.git cat-file commit $commit\n'> ) } ) (C {(test_expect_success)} {(SQ <'rejected objects are not installed'>)} { (SQ <'\n'> <'\ttest_commit reject &&\n'> <'\tcommit=$(git rev-parse HEAD) &&\n'> <'\ttest_must_fail git push dest.git reject &&\n'> <'\ttest_must_fail git --git-dir=dest.git cat-file commit $commit\n'> ) } ) (C {(test_expect_success)} {(SQ <'rejected objects are removed'>)} { (SQ <'\n'> <'\techo "incoming-*" >expect &&\n'> <'\t(cd dest.git/objects && echo incoming-*) >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_done)}) ] )