File tree Expand file tree Collapse file tree 12 files changed +39
-31
lines changed
loose/reflog/create_or_update Expand file tree Collapse file tree 12 files changed +39
-31
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ mod tests {
300
300
}
301
301
302
302
pub fn time_to_offset_date_time ( time : git:: actor:: Time ) -> OffsetDateTime {
303
- time:: OffsetDateTime :: from_unix_timestamp ( time. time as i64 )
303
+ time:: OffsetDateTime :: from_unix_timestamp ( time. seconds_since_unix_epoch as i64 )
304
304
. expect ( "always valid unix time" )
305
- . replace_offset ( time:: UtcOffset :: from_whole_seconds ( time. offset ) . expect ( "valid offset" ) )
305
+ . replace_offset ( time:: UtcOffset :: from_whole_seconds ( time. offset_in_seconds ) . expect ( "valid offset" ) )
306
306
}
Original file line number Diff line number Diff line change @@ -58,12 +58,10 @@ impl<'a> CommitRefIter<'a> {
58
58
/// if not exactly two signatures were iterable.
59
59
/// Errors are not the common case - if an error needs to be detectable, use this instance as iterator.
60
60
pub fn signatures ( & ' a mut self ) -> impl Iterator < Item = git_actor:: SignatureRef < ' _ > > + ' a {
61
- self . filter_map ( Result :: ok)
62
- . skip_while ( |t| !matches ! ( t, Token :: Author { .. } | Token :: Committer { .. } ) )
63
- . filter_map ( |t| match t {
64
- Token :: Author { signature } | Token :: Committer { signature } => Some ( signature) ,
65
- _ => None ,
66
- } )
61
+ self . filter_map ( |t| match t {
62
+ Ok ( Token :: Author { signature } ) | Ok ( Token :: Committer { signature } ) => Some ( signature) ,
63
+ _ => None ,
64
+ } )
67
65
}
68
66
69
67
/// Returns the committer signature if there is no decoding error.
Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ fn with_trailer() -> crate::Result {
139
139
name : "Kim Altintop" . into ( ) ,
140
140
email : "kim@eagain.st" . into ( ) ,
141
141
time : Time {
142
- time : 1631514803 ,
143
- offset : 7200 ,
142
+ seconds_since_unix_epoch : 1631514803 ,
143
+ offset_in_seconds : 7200 ,
144
144
sign : Sign :: Plus ,
145
145
} ,
146
146
} ;
Original file line number Diff line number Diff line change @@ -236,8 +236,8 @@ mod summary {
236
236
name : "name" . into ( ) ,
237
237
email : "email" . into ( ) ,
238
238
time : Time {
239
- time : 0 ,
240
- offset : 0 ,
239
+ seconds_since_unix_epoch : 0 ,
240
+ offset_in_seconds : 0 ,
241
241
sign : Sign :: Plus ,
242
242
} ,
243
243
} ;
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ fn signature(time: u32) -> git_actor::SignatureRef<'static> {
29
29
name : b"Sebastian Thiel" . as_bstr ( ) ,
30
30
email : b"sebastian.thiel@icloud.com" . as_bstr ( ) ,
31
31
time : Time {
32
- time,
33
- offset : 28800 ,
32
+ seconds_since_unix_epoch : time,
33
+ offset_in_seconds : 28800 ,
34
34
sign : Sign :: Plus ,
35
35
} ,
36
36
}
@@ -42,8 +42,8 @@ fn linus_signature(time: u32) -> git_actor::SignatureRef<'static> {
42
42
name : b"Linus Torvalds" . as_bstr ( ) ,
43
43
email : b"torvalds@linux-foundation.org" . as_bstr ( ) ,
44
44
time : Time {
45
- time,
46
- offset : -25200 ,
45
+ seconds_since_unix_epoch : time,
46
+ offset_in_seconds : -25200 ,
47
47
sign : Sign :: Minus ,
48
48
} ,
49
49
}
Original file line number Diff line number Diff line change @@ -234,8 +234,8 @@ cjHJZXWmV4CcRfmLsXzU8s2cR9A0DBvOxhPD1TlKC2JhBFXigjuL9U4Rbq9tdegB
234
234
name : b"Sebastian Thiel" . as_bstr ( ) ,
235
235
email : b"byronimo@gmail.com" . as_bstr ( ) ,
236
236
time : git_actor:: Time {
237
- time : 1528473343 ,
238
- offset,
237
+ seconds_since_unix_epoch : 1528473343 ,
238
+ offset_in_seconds : offset,
239
239
sign : git_actor:: Sign :: Plus ,
240
240
} ,
241
241
} ) ,
Original file line number Diff line number Diff line change @@ -288,8 +288,8 @@ fn signature(time: u32) -> git_actor::SignatureRef<'static> {
288
288
name : b"Sebastian Thiel" . as_bstr ( ) ,
289
289
email : b"byronimo@gmail.com" . as_bstr ( ) ,
290
290
time : Time {
291
- time,
292
- offset : 7200 ,
291
+ seconds_since_unix_epoch : time,
292
+ offset_in_seconds : 7200 ,
293
293
sign : Sign :: Plus ,
294
294
} ,
295
295
}
Original file line number Diff line number Diff line change @@ -229,8 +229,8 @@ pub mod decode {
229
229
name: b"name" . as_bstr( ) ,
230
230
email: b"foo@example.com" . as_bstr( ) ,
231
231
time: Time {
232
- time : 1234567890 ,
233
- offset : 0 ,
232
+ seconds_since_unix_epoch : 1234567890 ,
233
+ offset_in_seconds : 0 ,
234
234
sign: Sign :: Minus
235
235
}
236
236
} ,
@@ -255,8 +255,8 @@ pub mod decode {
255
255
name : b"Sebastian Thiel" . as_bstr ( ) ,
256
256
email : b"foo@example.com" . as_bstr ( ) ,
257
257
time : Time {
258
- time : 1618030561 ,
259
- offset : 28800 ,
258
+ seconds_since_unix_epoch : 1618030561 ,
259
+ offset_in_seconds : 28800 ,
260
260
sign : Sign :: Plus ,
261
261
} ,
262
262
} ,
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ fn missing_reflog_creates_it_even_if_similarly_named_empty_dir_exists_and_append
73
73
name : "committer" . into ( ) ,
74
74
email : "commiter@example.com" . into ( ) ,
75
75
time : Time {
76
- time : 1234 ,
77
- offset : 1800 ,
76
+ seconds_since_unix_epoch : 1234 ,
77
+ offset_in_seconds : 1800 ,
78
78
sign : Sign :: Plus ,
79
79
} ,
80
80
} ;
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ mod prepare_and_commit {
25
25
name : "committer" . into ( ) ,
26
26
email : "committer@example.com" . into ( ) ,
27
27
time : Time {
28
- time : 1234 ,
29
- offset : 1800 ,
28
+ seconds_since_unix_epoch : 1234 ,
29
+ offset_in_seconds : 1800 ,
30
30
sign : Sign :: Plus ,
31
31
} ,
32
32
}
You can’t perform that action at this time.
0 commit comments