Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-17 09:29:30 +0300
committerJunio C Hamano <gitster@pobox.com>2017-04-17 09:29:30 +0300
commitdfe46c5ce6e68d682f80f9874f0eb107e9fee797 (patch)
tree7af1c20e18cad0a46b8c2259416ecbd85a36c697 /t/t1060-object-corruption.sh
parent3c833cae446364872b759c7622af2760a2f81a11 (diff)
parent51054177b312ce0795f2866d4c3aed246eeccea9 (diff)
Merge branch 'jk/loose-object-info-report-error'
Update error handling for codepath that deals with corrupt loose objects. * jk/loose-object-info-report-error: index-pack: detect local corruption in collision check sha1_loose_object_info: return error for corrupted objects
Diffstat (limited to 't/t1060-object-corruption.sh')
-rwxr-xr-xt/t1060-object-corruption.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t1060-object-corruption.sh b/t/t1060-object-corruption.sh
index 3f8705139d..ac1f189fd2 100755
--- a/t/t1060-object-corruption.sh
+++ b/t/t1060-object-corruption.sh
@@ -21,6 +21,14 @@ test_expect_success 'setup corrupt repo' '
cd bit-error &&
test_commit content &&
corrupt_byte HEAD:content.t 10
+ ) &&
+ git init no-bit-error &&
+ (
+ # distinct commit from bit-error, but containing a
+ # non-corrupted version of the same blob
+ cd no-bit-error &&
+ test_tick &&
+ test_commit content
)
'
@@ -53,6 +61,13 @@ test_expect_success 'streaming a corrupt blob fails' '
)
'
+test_expect_success 'getting type of a corrupt blob fails' '
+ (
+ cd bit-error &&
+ test_must_fail git cat-file -s HEAD:content.t
+ )
+'
+
test_expect_success 'read-tree -u detects bit-errors in blobs' '
(
cd bit-error &&
@@ -101,4 +116,13 @@ test_expect_failure 'clone --local detects misnamed objects' '
test_must_fail git clone --local misnamed misnamed-checkout
'
+test_expect_success 'fetch into corrupted repo with index-pack' '
+ (
+ cd bit-error &&
+ test_must_fail git -c transfer.unpackLimit=1 \
+ fetch ../no-bit-error 2>stderr &&
+ test_i18ngrep ! -i collision stderr
+ )
+'
+
test_done