(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 <'Test git update-ref error handling'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: test_update_rejected body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.AndOr ops: [ Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp ] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'before='> name:before) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} spids: [52] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'pack='> name:pack) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 2))} spids: [60] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'create='> name:create) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 3))} spids: [68] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'error='> name:error) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 4))} spids: [76] ) ] redirects: [] ) (command.Pipeline children: [ (C {<printf>} { (DQ <'create '> ($ Id.VSub_DollarName prefix) <'/%s '> ($ Id.VSub_DollarName C) <Id.Lit_BadBackslash '\\'> <n> ) } {($ Id.VSub_DollarName before)} ) (C {<git>} {<update-ref>} {<--stdin>}) ] negated: F stderr_indices: [] ) (command.Simple words: [{<git>} {<for-each-ref>} {($ Id.VSub_DollarName prefix)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<unchanged>})] more_env: [] do_fork: T ) (command.If arms: [ (if_arm cond: (condition.Shell commands:[(C {($ Id.VSub_DollarName pack)})]) action: [(C {<git>} {<pack-refs>} {<--all>})] spids: [121 126] ) ] else_action: [] redirects: [] ) (command.Simple words: [ {<printf>} { (DQ <'create '> ($ Id.VSub_DollarName prefix) <'/%s '> ($ Id.VSub_DollarName C) <Id.Lit_BadBackslash '\\'> <n> ) } {($ Id.VSub_DollarName create)} ] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<input>})] more_env: [] do_fork: T ) (command.Simple words: [{<test_must_fail>} {<git>} {<update-ref>} {<--stdin>}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {<input>} ) (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<output.err>} ) ] more_env: [] do_fork: T ) (C {<grep>} {<-F>} {(DQ ($ Id.VSub_DollarName error))} {<output.err>}) (command.Simple words: [{<git>} {<for-each-ref>} {($ Id.VSub_DollarName prefix)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<actual>})] more_env: [] do_fork: T ) (C {<test_cmp>} {<unchanged>} {<actual>}) ] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'Q='> name:Q) op: assign_op.Equal rhs: {(DQ <'\''>)} spids: [211] ) ] redirects: [] ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\n'> <'\tgit commit --allow-empty -m Initial &&\n'> <'\tC=$(git rev-parse HEAD) &&\n'> <'\tgit commit --allow-empty -m Second &&\n'> <'\tD=$(git rev-parse HEAD) &&\n'> <'\tgit commit --allow-empty -m Third &&\n'> <'\tE=$(git rev-parse HEAD)\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing loose ref is a simple prefix of new'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/1l &&\n'> <'\ttest_update_rejected "a c e" false "b c/x d" \\\n'> <'\t\t"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing packed ref is a simple prefix of new'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/1p &&\n'> <'\ttest_update_rejected "a c e" true "b c/x d" \\\n'> <'\t\t"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing loose ref is a deeper prefix of new'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/2l &&\n'> <'\ttest_update_rejected "a c e" false "b c/x/y d" \\\n'> <'\t\t"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing packed ref is a deeper prefix of new'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/2p &&\n'> <'\ttest_update_rejected "a c e" true "b c/x/y d" \\\n'> <'\t\t"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'new ref is a simple prefix of existing loose'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/3l &&\n'> <'\ttest_update_rejected "a c/x e" false "b c d" \\\n'> <'\t\t"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'new ref is a simple prefix of existing packed'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/3p &&\n'> <'\ttest_update_rejected "a c/x e" true "b c d" \\\n'> <'\t\t"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'new ref is a deeper prefix of existing loose'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/4l &&\n'> <'\ttest_update_rejected "a c/x/y e" false "b c d" \\\n'> <'\t\t"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'new ref is a deeper prefix of existing packed'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/4p &&\n'> <'\ttest_update_rejected "a c/x/y e" true "b c d" \\\n'> <'\t\t"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'one new ref is a simple prefix of another'>)} { (SQ <'\n'> <'\n'> <'\tprefix=refs/5 &&\n'> <'\ttest_update_rejected "a e" false "b c c/x d" \\\n'> <'\t\t"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time"\n'> <'\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool rev-parse'>)} { (SQ <'\n'> <'\tprefix=refs/e-rev-parse &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\techo "$C" >expected &&\n'> <'\tgit rev-parse $prefix/foo >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool for-each-ref'>)} { (SQ <'\n'> <'\tprefix=refs/e-for-each-ref &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit for-each-ref $prefix >expected &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tgit for-each-ref $prefix >actual &&\n'> <'\ttest_cmp expected actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool create'>)} { (SQ <'\n'> <'\tprefix=refs/e-create &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "create %s $C\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool verify'>)} { (SQ <'\n'> <'\tprefix=refs/e-verify &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "verify %s $C\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool 1-arg update'>)} { (SQ <'\n'> <'\tprefix=refs/e-update-1 &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "update %s $D\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool 2-arg update'>)} { (SQ <'\n'> <'\tprefix=refs/e-update-2 &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "update %s $D $C\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool 0-arg delete'>)} { (SQ <'\n'> <'\tprefix=refs/e-delete-0 &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "delete %s\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'empty directory should not fool 1-arg delete'>)} { (SQ <'\n'> <'\tprefix=refs/e-delete-1 &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tgit pack-refs --all &&\n'> <'\tmkdir -p .git/$prefix/foo/bar/baz &&\n'> <'\tprintf "delete %s $C\\n" $prefix/foo |\n'> <'\tgit update-ref --stdin\n'> ) } ) (C {<test_expect_success>} {(SQ <'missing old value blocks update'>)} { (SQ <'\n'> <'\tprefix=refs/missing-update &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks update'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-update &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing old value blocks create'>)} { (SQ <'\n'> <'\tprefix=refs/existing-create &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/foo$Q: reference already exists\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "create $prefix/foo $E" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks delete'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-delete &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "delete $prefix/foo $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'missing old value blocks indirect update'>)} { (SQ <'\n'> <'\tprefix=refs/missing-indirect-update &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks indirect update'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-indirect-update &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing old value blocks indirect create'>)} { (SQ <'\n'> <'\tprefix=refs/existing-indirect-create &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "create $prefix/symref $E" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks indirect delete'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-indirect-delete &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "delete $prefix/symref $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'missing old value blocks indirect no-deref update'>)} { (SQ <'\n'> <'\tprefix=refs/missing-noderef-update &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: reference is missing but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "option no-deref" "update $prefix/symref $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks indirect no-deref update'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-noderef-update &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "option no-deref" "update $prefix/symref $E $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'existing old value blocks indirect no-deref create'>)} { (SQ <'\n'> <'\tprefix=refs/existing-noderef-create &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "option no-deref" "create $prefix/symref $E" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'incorrect old value blocks indirect no-deref delete'>)} { (SQ <'\n'> <'\tprefix=refs/incorrect-noderef-delete &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tgit update-ref $prefix/foo $C &&\n'> <'\tcat >expected <<-EOF &&\n'> <'\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n'> <'\tEOF\n'> <'\tprintf "%s\\n" "option no-deref" "delete $prefix/symref $D" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'non-empty directory blocks create'>)} { (SQ <'\n'> <'\tprefix=refs/ne-create &&\n'> <'\tmkdir -p .git/$prefix/foo/bar &&\n'> <'\t: >.git/$prefix/foo/bar/baz.lock &&\n'> <'\ttest_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/foo$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $D $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'broken reference blocks create'>)} { (SQ <'\n'> <'\tprefix=refs/broken-create &&\n'> <'\tmkdir -p .git/$prefix &&\n'> <'\techo "gobbledigook" >.git/$prefix/foo &&\n'> <'\ttest_when_finished "rm -f .git/$prefix/foo" &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/foo $D $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'non-empty directory blocks indirect create'>)} { (SQ <'\n'> <'\tprefix=refs/ne-indirect-create &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\tmkdir -p .git/$prefix/foo/bar &&\n'> <'\t: >.git/$prefix/foo/bar/baz.lock &&\n'> <'\ttest_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/symref$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $D $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_expect_success>} {(SQ <'broken reference blocks indirect create'>)} { (SQ <'\n'> <'\tprefix=refs/broken-indirect-create &&\n'> <'\tgit symbolic-ref $prefix/symref $prefix/foo &&\n'> <'\techo "gobbledigook" >.git/$prefix/foo &&\n'> <'\ttest_when_finished "rm -f .git/$prefix/foo" &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err &&\n'> <'\tcat >expected <<-EOF &&\n'> < '\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n' > <'\tEOF\n'> <'\tprintf "%s\\n" "update $prefix/symref $D $C" |\n'> <'\ttest_must_fail git update-ref --stdin 2>output.err &&\n'> <'\ttest_cmp expected output.err\n'> ) } ) (C {<test_done>}) ] )