-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'js/ls-tree-error' into maint
* js/ls-tree-error: Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails. Add a test to check that git ls-tree sets non-zero exit code on error.
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
test_description=' | ||
Miscellaneous tests for git ls-tree. | ||
1. git ls-tree fails in presence of tree damage. | ||
' | ||
|
||
. ./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 |