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