@@ -4,6 +4,80 @@ use std::{
4
4
} ;
5
5
use thiserror:: Error ;
6
6
7
+ ///
8
+ #[ derive( Error , Debug ) ]
9
+ pub enum GixError {
10
+ ///
11
+ #[ error( "gix::discover error: {0}" ) ]
12
+ Discover ( #[ from] Box < gix:: discover:: Error > ) ,
13
+
14
+ ///
15
+ #[ error( "gix::head::peel::to_commit error: {0}" ) ]
16
+ HeadPeelToCommit ( #[ from] gix:: head:: peel:: to_commit:: Error ) ,
17
+
18
+ ///
19
+ #[ error( "gix::object::find::existing::with_conversion::Error error: {0}" ) ]
20
+ ObjectFindExistingWithConversion (
21
+ #[ from] gix:: object:: find:: existing:: with_conversion:: Error ,
22
+ ) ,
23
+
24
+ ///
25
+ #[ error( "gix::objs::decode::Error error: {0}" ) ]
26
+ ObjsDecode ( #[ from] gix:: objs:: decode:: Error ) ,
27
+
28
+ ///
29
+ #[ error( "gix::pathspec::init::Error error: {0}" ) ]
30
+ PathspecInit ( #[ from] Box < gix:: pathspec:: init:: Error > ) ,
31
+
32
+ ///
33
+ #[ error( "gix::reference::find::existing error: {0}" ) ]
34
+ ReferenceFindExisting (
35
+ #[ from] gix:: reference:: find:: existing:: Error ,
36
+ ) ,
37
+
38
+ ///
39
+ #[ error( "gix::reference::head_tree_id::Error error: {0}" ) ]
40
+ ReferenceHeadTreeId ( #[ from] gix:: reference:: head_tree_id:: Error ) ,
41
+
42
+ ///
43
+ #[ error( "gix::reference::iter::Error error: {0}" ) ]
44
+ ReferenceIter ( #[ from] gix:: reference:: iter:: Error ) ,
45
+
46
+ ///
47
+ #[ error( "gix::reference::iter::init::Error error: {0}" ) ]
48
+ ReferenceIterInit ( #[ from] gix:: reference:: iter:: init:: Error ) ,
49
+
50
+ ///
51
+ #[ error( "gix::revision::walk error: {0}" ) ]
52
+ RevisionWalk ( #[ from] gix:: revision:: walk:: Error ) ,
53
+
54
+ ///
55
+ #[ error( "gix::status::Error error: {0}" ) ]
56
+ Status ( #[ from] Box < gix:: status:: Error > ) ,
57
+
58
+ ///
59
+ #[ error( "gix::status::index_worktree::Error error: {0}" ) ]
60
+ StatusIndexWorktree (
61
+ #[ from] Box < gix:: status:: index_worktree:: Error > ,
62
+ ) ,
63
+
64
+ ///
65
+ #[ error( "gix::status::into_iter::Error error: {0}" ) ]
66
+ StatusIntoIter ( #[ from] Box < gix:: status:: into_iter:: Error > ) ,
67
+
68
+ ///
69
+ #[ error( "gix::status::iter::Error error: {0}" ) ]
70
+ StatusIter ( #[ from] Box < gix:: status:: iter:: Error > ) ,
71
+
72
+ ///
73
+ #[ error( "gix::status::tree_index::Error error: {0}" ) ]
74
+ StatusTreeIndex ( #[ from] Box < gix:: status:: tree_index:: Error > ) ,
75
+
76
+ ///
77
+ #[ error( "gix::worktree::open_index::Error error: {0}" ) ]
78
+ WorktreeOpenIndex ( #[ from] Box < gix:: worktree:: open_index:: Error > ) ,
79
+ }
80
+
7
81
///
8
82
#[ derive( Error , Debug ) ]
9
83
pub enum Error {
@@ -96,70 +170,8 @@ pub enum Error {
96
170
Sign ( #[ from] crate :: sync:: sign:: SignError ) ,
97
171
98
172
///
99
- #[ error( "gix::discover error: {0}" ) ]
100
- GixDiscover ( #[ from] Box < gix:: discover:: Error > ) ,
101
-
102
- ///
103
- #[ error( "gix::reference::find::existing error: {0}" ) ]
104
- GixReferenceFindExisting (
105
- #[ from] gix:: reference:: find:: existing:: Error ,
106
- ) ,
107
-
108
- ///
109
- #[ error( "gix::head::peel::to_commit error: {0}" ) ]
110
- GixHeadPeelToCommit ( #[ from] gix:: head:: peel:: to_commit:: Error ) ,
111
-
112
- ///
113
- #[ error( "gix::revision::walk error: {0}" ) ]
114
- GixRevisionWalk ( #[ from] gix:: revision:: walk:: Error ) ,
115
-
116
- ///
117
- #[ error( "gix::objs::decode::Error error: {0}" ) ]
118
- GixObjsDecode ( #[ from] gix:: objs:: decode:: Error ) ,
119
-
120
- ///
121
- #[ error( "gix::object::find::existing::with_conversion::Error error: {0}" ) ]
122
- GixObjectFindExistingWithConversionError (
123
- #[ from] gix:: object:: find:: existing:: with_conversion:: Error ,
124
- ) ,
125
-
126
- ///
127
- #[ error( "gix::pathspec::init::Error error: {0}" ) ]
128
- GixPathspecInit ( #[ from] Box < gix:: pathspec:: init:: Error > ) ,
129
-
130
- ///
131
- #[ error( "gix::reference::head_tree_id::Error error: {0}" ) ]
132
- GixReferenceHeadTreeId (
133
- #[ from] gix:: reference:: head_tree_id:: Error ,
134
- ) ,
135
-
136
- ///
137
- #[ error( "gix::status::Error error: {0}" ) ]
138
- GixStatus ( #[ from] Box < gix:: status:: Error > ) ,
139
-
140
- ///
141
- #[ error( "gix::status::iter::Error error: {0}" ) ]
142
- GixStatusIter ( #[ from] Box < gix:: status:: iter:: Error > ) ,
143
-
144
- ///
145
- #[ error( "gix::status::into_iter::Error error: {0}" ) ]
146
- GixStatusIntoIter ( #[ from] Box < gix:: status:: into_iter:: Error > ) ,
147
-
148
- ///
149
- #[ error( "gix::status::index_worktree::Error error: {0}" ) ]
150
- GixStatusIndexWorktree (
151
- #[ from] Box < gix:: status:: index_worktree:: Error > ,
152
- ) ,
153
-
154
- ///
155
- #[ error( "gix::status::tree_index::Error error: {0}" ) ]
156
- GixStatusTreeIndex ( #[ from] Box < gix:: status:: tree_index:: Error > ) ,
157
-
158
- ///
159
- #[ error( "gix::worktree::open_index::Error error: {0}" ) ]
160
- GixWorktreeOpenIndex (
161
- #[ from] Box < gix:: worktree:: open_index:: Error > ,
162
- ) ,
173
+ #[ error( "gix error:{0}" ) ]
174
+ Gix ( #[ from] GixError ) ,
163
175
164
176
///
165
177
#[ error( "amend error: config commit.gpgsign=true detected.\n gpg signing is not supported for amending non-last commits" ) ]
@@ -189,50 +201,150 @@ impl<T> From<crossbeam_channel::SendError<T>> for Error {
189
201
}
190
202
}
191
203
204
+ impl From < gix:: discover:: Error > for GixError {
205
+ fn from ( error : gix:: discover:: Error ) -> Self {
206
+ Self :: Discover ( Box :: new ( error) )
207
+ }
208
+ }
209
+
192
210
impl From < gix:: discover:: Error > for Error {
193
211
fn from ( error : gix:: discover:: Error ) -> Self {
194
- Self :: GixDiscover ( Box :: new ( error) )
212
+ Self :: Gix ( GixError :: from ( error) )
213
+ }
214
+ }
215
+
216
+ impl From < gix:: head:: peel:: to_commit:: Error > for Error {
217
+ fn from ( error : gix:: head:: peel:: to_commit:: Error ) -> Self {
218
+ Self :: Gix ( GixError :: from ( error) )
219
+ }
220
+ }
221
+
222
+ impl From < gix:: object:: find:: existing:: with_conversion:: Error >
223
+ for Error
224
+ {
225
+ fn from (
226
+ error : gix:: object:: find:: existing:: with_conversion:: Error ,
227
+ ) -> Self {
228
+ Self :: Gix ( GixError :: from ( error) )
229
+ }
230
+ }
231
+
232
+ impl From < gix:: objs:: decode:: Error > for Error {
233
+ fn from ( error : gix:: objs:: decode:: Error ) -> Self {
234
+ Self :: Gix ( GixError :: from ( error) )
235
+ }
236
+ }
237
+
238
+ impl From < gix:: pathspec:: init:: Error > for GixError {
239
+ fn from ( error : gix:: pathspec:: init:: Error ) -> Self {
240
+ Self :: PathspecInit ( Box :: new ( error) )
195
241
}
196
242
}
197
243
198
244
impl From < gix:: pathspec:: init:: Error > for Error {
199
245
fn from ( error : gix:: pathspec:: init:: Error ) -> Self {
200
- Self :: GixPathspecInit ( Box :: new ( error) )
246
+ Self :: Gix ( GixError :: from ( error) )
247
+ }
248
+ }
249
+
250
+ impl From < gix:: reference:: find:: existing:: Error > for Error {
251
+ fn from ( error : gix:: reference:: find:: existing:: Error ) -> Self {
252
+ Self :: Gix ( GixError :: from ( error) )
253
+ }
254
+ }
255
+
256
+ impl From < gix:: reference:: head_tree_id:: Error > for Error {
257
+ fn from ( error : gix:: reference:: head_tree_id:: Error ) -> Self {
258
+ Self :: Gix ( GixError :: from ( error) )
259
+ }
260
+ }
261
+
262
+ impl From < gix:: reference:: iter:: Error > for Error {
263
+ fn from ( error : gix:: reference:: iter:: Error ) -> Self {
264
+ Self :: Gix ( GixError :: from ( error) )
265
+ }
266
+ }
267
+
268
+ impl From < gix:: reference:: iter:: init:: Error > for Error {
269
+ fn from ( error : gix:: reference:: iter:: init:: Error ) -> Self {
270
+ Self :: Gix ( GixError :: from ( error) )
271
+ }
272
+ }
273
+
274
+ impl From < gix:: revision:: walk:: Error > for Error {
275
+ fn from ( error : gix:: revision:: walk:: Error ) -> Self {
276
+ Self :: Gix ( GixError :: from ( error) )
277
+ }
278
+ }
279
+
280
+ impl From < gix:: status:: Error > for GixError {
281
+ fn from ( error : gix:: status:: Error ) -> Self {
282
+ Self :: Status ( Box :: new ( error) )
201
283
}
202
284
}
203
285
204
286
impl From < gix:: status:: Error > for Error {
205
287
fn from ( error : gix:: status:: Error ) -> Self {
206
- Self :: GixStatus ( Box :: new ( error) )
288
+ Self :: Gix ( GixError :: from ( error) )
289
+ }
290
+ }
291
+
292
+ impl From < gix:: status:: iter:: Error > for GixError {
293
+ fn from ( error : gix:: status:: iter:: Error ) -> Self {
294
+ Self :: StatusIter ( Box :: new ( error) )
207
295
}
208
296
}
209
297
210
298
impl From < gix:: status:: iter:: Error > for Error {
211
299
fn from ( error : gix:: status:: iter:: Error ) -> Self {
212
- Self :: GixStatusIter ( Box :: new ( error) )
300
+ Self :: Gix ( GixError :: from ( error) )
301
+ }
302
+ }
303
+
304
+ impl From < gix:: status:: into_iter:: Error > for GixError {
305
+ fn from ( error : gix:: status:: into_iter:: Error ) -> Self {
306
+ Self :: StatusIntoIter ( Box :: new ( error) )
213
307
}
214
308
}
215
309
216
310
impl From < gix:: status:: into_iter:: Error > for Error {
217
311
fn from ( error : gix:: status:: into_iter:: Error ) -> Self {
218
- Self :: GixStatusIntoIter ( Box :: new ( error) )
312
+ Self :: Gix ( GixError :: from ( error) )
313
+ }
314
+ }
315
+
316
+ impl From < gix:: status:: index_worktree:: Error > for GixError {
317
+ fn from ( error : gix:: status:: index_worktree:: Error ) -> Self {
318
+ Self :: StatusIndexWorktree ( Box :: new ( error) )
219
319
}
220
320
}
221
321
222
322
impl From < gix:: status:: index_worktree:: Error > for Error {
223
323
fn from ( error : gix:: status:: index_worktree:: Error ) -> Self {
224
- Self :: GixStatusIndexWorktree ( Box :: new ( error) )
324
+ Self :: Gix ( GixError :: from ( error) )
325
+ }
326
+ }
327
+
328
+ impl From < gix:: status:: tree_index:: Error > for GixError {
329
+ fn from ( error : gix:: status:: tree_index:: Error ) -> Self {
330
+ Self :: StatusTreeIndex ( Box :: new ( error) )
225
331
}
226
332
}
227
333
228
334
impl From < gix:: status:: tree_index:: Error > for Error {
229
335
fn from ( error : gix:: status:: tree_index:: Error ) -> Self {
230
- Self :: GixStatusTreeIndex ( Box :: new ( error) )
336
+ Self :: Gix ( GixError :: from ( error) )
337
+ }
338
+ }
339
+
340
+ impl From < gix:: worktree:: open_index:: Error > for GixError {
341
+ fn from ( error : gix:: worktree:: open_index:: Error ) -> Self {
342
+ Self :: WorktreeOpenIndex ( Box :: new ( error) )
231
343
}
232
344
}
233
345
234
346
impl From < gix:: worktree:: open_index:: Error > for Error {
235
347
fn from ( error : gix:: worktree:: open_index:: Error ) -> Self {
236
- Self :: GixWorktreeOpenIndex ( Box :: new ( error) )
348
+ Self :: Gix ( GixError :: from ( error) )
237
349
}
238
350
}
0 commit comments