#!/bin/sh global test_description := ''remote push rejects are reported by client'' source ./test-lib.sh test_expect_success 'setup' ' mkdir .git/hooks && (echo "#!/bin/sh" ; echo "exit 1") >.git/hooks/update && chmod +x .git/hooks/update && echo 1 >file && git add file && git commit -m 1 && git clone . child && cd child && echo 2 >file && git commit -a -m 2 ' test_expect_success 'push reports error' 'test_must_fail git push 2>stderr' test_expect_success 'individual ref reports error' 'grep rejected stderr' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"remote push rejects are reported by client">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\tmkdir .git/hooks &&\n"> <"\t(echo \"#!/bin/sh\" ; echo \"exit 1\") >.git/hooks/update &&\n"> <"\tchmod +x .git/hooks/update &&\n"> <"\techo 1 >file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m 1 &&\n"> <"\tgit clone . child &&\n"> <"\tcd child &&\n"> <"\techo 2 >file &&\n"> <"\tgit commit -a -m 2\n"> ) } ) (C {(test_expect_success)} {(SQ <"push reports error">)} {(SQ <"test_must_fail git push 2>stderr">)}) (C {(test_expect_success)} {(SQ <"individual ref reports error">)} {(SQ <"grep rejected stderr">)}) (C {(test_done)}) ] )