diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-16 14:32:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-16 14:32:50 -0700 |
commit | 1c7dc12c43e138092d01305e400494ff331aebb4 (patch) | |
tree | 632c2849e637b253dd6ebd260f16f6cb202da7d5 /t | |
parent | 8f6f1771da430442f81027714519eaeadcbaa01e (diff) | |
parent | 122f76f574ce260429bfbd11251eed15039e3469 (diff) | |
download | git-1c7dc12c43e138092d01305e400494ff331aebb4.tar.gz git-1c7dc12c43e138092d01305e400494ff331aebb4.tar.xz |
Merge branch 'jc/fsck-dropped-errors' into maint
There were some classes of errors that "git fsck" diagnosed to its
standard error that did not cause it to exit with non-zero status.
* jc/fsck-dropped-errors:
fsck: exit with non-zero when problems are found
Diffstat (limited to 't')
-rwxr-xr-x | t/t1450-fsck.sh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 956673b8a..dc0979702 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -77,11 +77,31 @@ test_expect_success 'object with bad sha1' ' test_expect_success 'branch pointing to non-commit' ' git rev-parse HEAD^{tree} >.git/refs/heads/invalid && test_when_finished "git update-ref -d refs/heads/invalid" && - git fsck 2>out && + test_must_fail git fsck 2>out && cat out && grep "not a commit" out ' +test_expect_success 'HEAD link pointing at a funny object' ' + test_when_finished "mv .git/SAVED_HEAD .git/HEAD" && + mv .git/HEAD .git/SAVED_HEAD && + echo 0000000000000000000000000000000000000000 >.git/HEAD && + # avoid corrupt/broken HEAD from interfering with repo discovery + test_must_fail env GIT_DIR=.git git fsck 2>out && + cat out && + grep "detached HEAD points" out +' + +test_expect_success 'HEAD link pointing at a funny place' ' + test_when_finished "mv .git/SAVED_HEAD .git/HEAD" && + mv .git/HEAD .git/SAVED_HEAD && + echo "ref: refs/funny/place" >.git/HEAD && + # avoid corrupt/broken HEAD from interfering with repo discovery + test_must_fail env GIT_DIR=.git git fsck 2>out && + cat out && + grep "HEAD points to something strange" out +' + test_expect_success 'email without @ is okay' ' git cat-file commit HEAD >basis && sed "s/@/AT/" basis >okay && |