2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-10 23:31:09 +00:00

checker: test file mode

This commit is contained in:
Alexander Neumann 2016-04-10 17:25:15 +02:00
parent 168cfc2f6d
commit 6655511ab8

View File

@ -586,6 +586,10 @@ func (c *Checker) checkTree(id backend.ID, tree *restic.Tree) (errs []error) {
errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q has nil blob list", node.Name)}) errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q has nil blob list", node.Name)})
} }
if node.Mode == 0 {
errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q has invalid mode: %v", node.Name, node.Mode)})
}
for b, blobID := range node.Content { for b, blobID := range node.Content {
if blobID.IsNull() { if blobID.IsNull() {
errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q blob %d has null ID", node.Name, b)}) errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q blob %d has null ID", node.Name, b)})