File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 6
6
"io"
7
7
"os"
8
8
"path/filepath"
9
+ "strings"
9
10
10
11
bstore "github.com/ipfs/go-ipfs/blocks/blockstore"
11
12
cmds "github.com/ipfs/go-ipfs/commands"
@@ -263,6 +264,8 @@ var repoVerifyCmd = &cmds.Command{
263
264
}
264
265
if fails == 0 {
265
266
out <- & VerifyProgress {Message : "verify complete, all blocks validated." }
267
+ } else {
268
+ out <- & VerifyProgress {Message : "verify complete, some blocks were corrupt." }
266
269
}
267
270
}()
268
271
@@ -280,6 +283,9 @@ var repoVerifyCmd = &cmds.Command{
280
283
281
284
buf := new (bytes.Buffer )
282
285
if obj .Message != "" {
286
+ if strings .Contains (obj .Message , "blocks were corrupt" ) {
287
+ return nil , fmt .Errorf (obj .Message )
288
+ }
283
289
if len (obj .Message ) < 20 {
284
290
obj .Message += " "
285
291
}
Original file line number Diff line number Diff line change @@ -34,4 +34,9 @@ test_expect_success 'getting modified block fails' '
34
34
grep "block in storage has different hash than requested" err_msg
35
35
'
36
36
37
+ test_expect_success " block shows up in repo verify" '
38
+ test_expect_code 1 ipfs repo verify > verify_out &&
39
+ grep "$H_BLOCK2" verify_out
40
+ '
41
+
37
42
test_done
You can’t perform that action at this time.
0 commit comments