1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.internal.fsck;
11
12 import java.util.HashSet;
13 import java.util.Set;
14
15 import org.eclipse.jgit.annotations.Nullable;
16 import org.eclipse.jgit.errors.CorruptPackIndexException;
17 import org.eclipse.jgit.errors.CorruptPackIndexException.ErrorType;
18 import org.eclipse.jgit.lib.ObjectChecker;
19 import org.eclipse.jgit.lib.ObjectId;
20
21
22
23
24 public class FsckError {
25
26 public static class CorruptObject {
27 final ObjectId id;
28
29 final int type;
30
31 @Nullable
32 final ObjectChecker.ErrorType errorType;
33
34
35
36
37
38
39
40
41
42 public CorruptObject(ObjectId id, int type,
43 @Nullable ObjectChecker.ErrorType errorType) {
44 this.id = id;
45 this.type = type;
46 this.errorType = errorType;
47 }
48
49
50 public ObjectId getId() {
51 return id;
52 }
53
54
55 public int getType() {
56 return type;
57 }
58
59
60 @Nullable
61 public ObjectChecker.ErrorType getErrorType() {
62 return errorType;
63 }
64 }
65
66
67 public static class CorruptIndex {
68 String fileName;
69
70 CorruptPackIndexException.ErrorType errorType;
71
72
73
74
75
76
77
78
79 public CorruptIndex(String fileName, ErrorType errorType) {
80 this.fileName = fileName;
81 this.errorType = errorType;
82 }
83
84
85 public String getFileName() {
86 return fileName;
87 }
88
89
90 public ErrorType getErrorType() {
91 return errorType;
92 }
93 }
94
95 private final Set<CorruptObject> corruptObjects = new HashSet<>();
96
97 private final Set<ObjectId> missingObjects = new HashSet<>();
98
99 private final Set<CorruptIndex> corruptIndices = new HashSet<>();
100
101 private final Set<String> nonCommitHeads = new HashSet<>();
102
103
104
105
106
107
108 public Set<CorruptObject> getCorruptObjects() {
109 return corruptObjects;
110 }
111
112
113
114
115
116
117 public Set<ObjectId> getMissingObjects() {
118 return missingObjects;
119 }
120
121
122
123
124
125
126 public Set<CorruptIndex> getCorruptIndices() {
127 return corruptIndices;
128 }
129
130
131
132
133
134
135 public Set<String> getNonCommitHeads() {
136 return nonCommitHeads;
137 }
138 }