1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.eclipse.jgit.lib;
15
16 import org.eclipse.jgit.internal.JGitText;
17
18
19
20
21
22
23
24 public enum RepositoryState {
25
26 BARE {
27 @Override
28 public boolean canCheckout() { return false; }
29
30 @Override
31 public boolean canResetHead() { return false; }
32
33 @Override
34 public boolean canCommit() { return false; }
35
36 @Override
37 public boolean canAmend() { return false; }
38
39 @Override
40 public boolean isRebasing() { return false; }
41
42 @Override
43 public String getDescription() {
44 return JGitText.get().repositoryState_bare;
45 }
46 },
47
48
49
50
51 SAFE {
52 @Override
53 public boolean canCheckout() { return true; }
54
55 @Override
56 public boolean canResetHead() { return true; }
57
58 @Override
59 public boolean canCommit() { return true; }
60
61 @Override
62 public boolean canAmend() { return true; }
63
64 @Override
65 public boolean isRebasing() { return false; }
66
67 @Override
68 public String getDescription() { return JGitText.get().repositoryState_normal; }
69 },
70
71
72
73 MERGING {
74 @Override
75 public boolean canCheckout() { return false; }
76
77 @Override
78 public boolean canResetHead() { return true; }
79
80 @Override
81 public boolean canCommit() { return false; }
82
83 @Override
84 public boolean canAmend() { return false; }
85
86 @Override
87 public boolean isRebasing() { return false; }
88
89 @Override
90 public String getDescription() { return JGitText.get().repositoryState_conflicts; }
91 },
92
93
94
95
96
97 MERGING_RESOLVED {
98 @Override
99 public boolean canCheckout() { return true; }
100
101 @Override
102 public boolean canResetHead() { return true; }
103
104 @Override
105 public boolean canCommit() { return true; }
106
107 @Override
108 public boolean canAmend() { return false; }
109
110 @Override
111 public boolean isRebasing() { return false; }
112
113 @Override
114 public String getDescription() { return JGitText.get().repositoryState_merged; }
115 },
116
117
118
119 CHERRY_PICKING {
120 @Override
121 public boolean canCheckout() { return false; }
122
123 @Override
124 public boolean canResetHead() { return true; }
125
126 @Override
127 public boolean canCommit() { return false; }
128
129 @Override
130 public boolean canAmend() { return false; }
131
132 @Override
133 public boolean isRebasing() { return false; }
134
135 @Override
136 public String getDescription() { return JGitText.get().repositoryState_conflicts; }
137 },
138
139
140
141
142
143 CHERRY_PICKING_RESOLVED {
144 @Override
145 public boolean canCheckout() { return true; }
146
147 @Override
148 public boolean canResetHead() { return true; }
149
150 @Override
151 public boolean canCommit() { return true; }
152
153 @Override
154 public boolean canAmend() { return false; }
155
156 @Override
157 public boolean isRebasing() { return false; }
158
159 @Override
160 public String getDescription() { return JGitText.get().repositoryState_merged; }
161 },
162
163
164
165 REVERTING {
166 @Override
167 public boolean canCheckout() { return false; }
168
169 @Override
170 public boolean canResetHead() { return true; }
171
172 @Override
173 public boolean canCommit() { return false; }
174
175 @Override
176 public boolean canAmend() { return false; }
177
178 @Override
179 public boolean isRebasing() { return false; }
180
181 @Override
182 public String getDescription() { return JGitText.get().repositoryState_conflicts; }
183 },
184
185
186
187
188
189 REVERTING_RESOLVED {
190 @Override
191 public boolean canCheckout() { return true; }
192
193 @Override
194 public boolean canResetHead() { return true; }
195
196 @Override
197 public boolean canCommit() { return true; }
198
199 @Override
200 public boolean canAmend() { return false; }
201
202 @Override
203 public boolean isRebasing() { return false; }
204
205 @Override
206 public String getDescription() { return JGitText.get().repositoryState_merged; }
207 },
208
209
210
211
212 REBASING {
213 @Override
214 public boolean canCheckout() { return false; }
215
216 @Override
217 public boolean canResetHead() { return false; }
218
219 @Override
220 public boolean canCommit() { return true; }
221
222 @Override
223 public boolean canAmend() { return true; }
224
225 @Override
226 public boolean isRebasing() { return true; }
227
228 @Override
229 public String getDescription() { return JGitText.get().repositoryState_rebaseOrApplyMailbox; }
230 },
231
232
233
234
235 REBASING_REBASING {
236 @Override
237 public boolean canCheckout() { return false; }
238
239 @Override
240 public boolean canResetHead() { return false; }
241
242 @Override
243 public boolean canCommit() { return true; }
244
245 @Override
246 public boolean canAmend() { return true; }
247
248 @Override
249 public boolean isRebasing() { return true; }
250
251 @Override
252 public String getDescription() { return JGitText.get().repositoryState_rebase; }
253 },
254
255
256
257
258 APPLY {
259 @Override
260 public boolean canCheckout() { return false; }
261
262 @Override
263 public boolean canResetHead() { return false; }
264
265 @Override
266 public boolean canCommit() { return true; }
267
268 @Override
269 public boolean canAmend() { return true; }
270
271 @Override
272 public boolean isRebasing() { return false; }
273
274 @Override
275 public String getDescription() { return JGitText.get().repositoryState_applyMailbox; }
276 },
277
278
279
280
281 REBASING_MERGE {
282 @Override
283 public boolean canCheckout() { return false; }
284
285 @Override
286 public boolean canResetHead() { return false; }
287
288 @Override
289 public boolean canCommit() { return true; }
290
291 @Override
292 public boolean canAmend() { return true; }
293
294 @Override
295 public boolean isRebasing() { return true; }
296
297 @Override
298 public String getDescription() { return JGitText.get().repositoryState_rebaseWithMerge; }
299 },
300
301
302
303
304 REBASING_INTERACTIVE {
305 @Override
306 public boolean canCheckout() { return false; }
307
308 @Override
309 public boolean canResetHead() { return false; }
310
311 @Override
312 public boolean canCommit() { return true; }
313
314 @Override
315 public boolean canAmend() { return true; }
316
317 @Override
318 public boolean isRebasing() { return true; }
319
320 @Override
321 public String getDescription() { return JGitText.get().repositoryState_rebaseInteractive; }
322 },
323
324
325
326
327 BISECTING {
328
329 @Override
330 public boolean canCheckout() { return true; }
331
332
333 @Override
334 public boolean canResetHead() { return false; }
335
336
337 @Override
338 public boolean canCommit() { return true; }
339
340 @Override
341 public boolean canAmend() { return false; }
342
343 @Override
344 public boolean isRebasing() { return false; }
345
346 @Override
347 public String getDescription() { return JGitText.get().repositoryState_bisecting; }
348 };
349
350
351
352
353
354
355 public abstract boolean canCheckout();
356
357
358
359
360 public abstract boolean canCommit();
361
362
363
364
365 public abstract boolean canResetHead();
366
367
368
369
370 public abstract boolean canAmend();
371
372
373
374
375
376 public abstract boolean isRebasing();
377
378
379
380
381 public abstract String getDescription();
382 }