#!/bin/sh global test_description := '' Miscellaneous tests for git ls-tree. 1. git ls-tree fails in presence of tree damage. '' source ./test-lib.sh test_expect_success 'setup' ' mkdir a && touch a/one && git add a/one && git commit -m test ' test_expect_success 'ls-tree fails with non-zero exit code on broken tree' ' rm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 && test_must_fail git ls-tree -r HEAD ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <"\n"> <"Miscellaneous tests for git ls-tree.\n"> <"\n"> <"\t 1. git ls-tree fails in presence of tree damage.\n"> <"\n"> ) } spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\tmkdir a &&\n"> <"\ttouch a/one &&\n"> <"\tgit add a/one &&\n"> <"\tgit commit -m test\n"> ) } ) (C {(test_expect_success)} {(SQ <"ls-tree fails with non-zero exit code on broken tree">)} { (SQ <"\n"> <"\trm -f .git/objects/5f/cffbd6e4c5c5b8d81f5e9314b20e338e3ffff5 &&\n"> <"\ttest_must_fail git ls-tree -r HEAD\n"> ) } ) (C {(test_done)}) ] )