(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'tests for ref^{stuff}'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\techo blob >a-blob &&\n'> <'\tgit tag -a -m blob blob-tag $(git hash-object -w a-blob) &&\n'> <'\tmkdir a-tree &&\n'> <'\techo moreblobs >a-tree/another-blob &&\n'> <'\tgit add . &&\n'> <'\tTREE_SHA1=$(git write-tree) &&\n'> <'\tgit tag -a -m tree tree-tag "$TREE_SHA1" &&\n'> <'\tgit commit -m Initial &&\n'> <'\tgit tag -a -m commit commit-tag &&\n'> <'\tgit branch ref &&\n'> <'\tgit checkout master &&\n'> <'\techo modified >>a-blob &&\n'> <'\tgit add -u &&\n'> <'\tgit commit -m Modified &&\n'> <'\tgit branch modref &&\n'> <'\techo changed! >>a-blob &&\n'> <'\tgit add -u &&\n'> <'\tgit commit -m !Exp &&\n'> <'\tgit branch expref &&\n'> <'\techo changed >>a-blob &&\n'> <'\tgit add -u &&\n'> <'\tgit commit -m Changed &&\n'> <'\techo changed-again >>a-blob &&\n'> <'\tgit add -u &&\n'> <'\tgit commit -m Changed-again\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{non-existent}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse ref^{non-existent}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{}'>)} { (SQ <'\n'> <'\tgit rev-parse ref >expected &&\n'> <'\tgit rev-parse ref^{} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit rev-parse commit-tag^{} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{commit}'>)} { (SQ <'\n'> <'\tgit rev-parse ref >expected &&\n'> <'\tgit rev-parse ref^{commit} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit rev-parse commit-tag^{commit} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\ttest_must_fail git rev-parse tree-tag^{commit} &&\n'> <'\ttest_must_fail git rev-parse blob-tag^{commit}\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{tree}'>)} { (SQ <'\n'> <'\techo $TREE_SHA1 >expected &&\n'> <'\tgit rev-parse ref^{tree} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit rev-parse commit-tag^{tree} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\tgit rev-parse tree-tag^{tree} >actual &&\n'> <'\ttest_cmp expected actual &&\n'> <'\ttest_must_fail git rev-parse blob-tag^{tree}\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{tag}'>)} { (SQ <'\n'> <'\ttest_must_fail git rev-parse HEAD^{tag} &&\n'> <'\tgit rev-parse commit-tag >expected &&\n'> <'\tgit rev-parse commit-tag^{tag} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/.}'>)} { (SQ <'\n'> <'\tgit rev-parse master >expected &&\n'> <'\tgit rev-parse master^{/.} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/non-existent}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse master^{/non-existent}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{/Initial}'>)} { (SQ <'\n'> <'\tgit rev-parse ref >expected &&\n'> <'\tgit rev-parse master^{/Initial} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/!Exp}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse master^{/!Exp}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{/!}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse master^{/!}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{/!!Exp}'>)} { (SQ <'\n'> <'\tgit rev-parse expref >expected &&\n'> <'\tgit rev-parse master^{/!!Exp} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/!-}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse master^{/!-}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{/!-.}'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse master^{/!-.}\n'>)} ) (C {(test_expect_success)} {(SQ <'ref^{/!-non-existent}'>)} { (SQ <'\n'> <'\tgit rev-parse master >expected &&\n'> <'\tgit rev-parse master^{/!-non-existent} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/!-Changed}'>)} { (SQ <'\n'> <'\tgit rev-parse expref >expected &&\n'> <'\tgit rev-parse master^{/!-Changed} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_expect_success)} {(SQ <'ref^{/!-!Exp}'>)} { (SQ <'\n'> <'\tgit rev-parse modref >expected &&\n'> <'\tgit rev-parse expref^{/!-!Exp} >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {(test_done)}) ] )