Unified · Split
| @@ -300,7 +300,7 @@ mod tests { · 299 unmodified lines | |||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | pub fn time_to_offset_date_time(time: gix::actor::Time) -> OffsetDateTime { | 302 | pub fn time_to_offset_date_time(time: gix::actor::Time) -> OffsetDateTime { |
| 303 | time::OffsetDateTime::from_unix_timestamp(time.seconds_since_unix_epoch as i64) | 303 | time::OffsetDateTime::from_unix_timestamp(time.seconds as i64) |
| 304 | .expect("always valid unix time") | 304 | .expect("always valid unix time") |
| 305 | .replace_offset(time::UtcOffset::from_whole_seconds(time.offset_in_seconds).expect("valid offset")) | 305 | .replace_offset(time::UtcOffset::from_whole_seconds(time.offset).expect("valid offset")) |
| 306 | } | 306 | } |
| @@ -24,11 +24,7 @@ pub fn estimate_hours( · 23 unmodified lines | |||
| 24 | let hours_for_commits = commits.iter().map(|t| &t.1).rev().tuple_windows().fold( | 24 | let hours_for_commits = commits.iter().map(|t| &t.1).rev().tuple_windows().fold( |
| 25 | 0_f32, | 25 | 0_f32, |
| 26 | |hours, (cur, next): (&gix::actor::SignatureRef<'_>, &gix::actor::SignatureRef<'_>)| { | 26 | |hours, (cur, next): (&gix::actor::SignatureRef<'_>, &gix::actor::SignatureRef<'_>)| { |
| 27 | let change_in_minutes = (next | 27 | let change_in_minutes = (next.time.seconds.saturating_sub(cur.time.seconds)) as f32 / MINUTES_PER_HOUR; |
| 28 | .time | ||
| 29 | .seconds_since_unix_epoch | ||
| 30 | .saturating_sub(cur.time.seconds_since_unix_epoch)) as f32 | ||
| 31 | / MINUTES_PER_HOUR; | ||
| 32 | if change_in_minutes < MAX_COMMIT_DIFFERENCE_IN_MINUTES { | 28 | if change_in_minutes < MAX_COMMIT_DIFFERENCE_IN_MINUTES { |
| 33 | hours + change_in_minutes / MINUTES_PER_HOUR | 29 | hours + change_in_minutes / MINUTES_PER_HOUR |
| 34 | } else { | 30 | } else { |
| @@ -95,12 +95,9 @@ where · 94 unmodified lines | |||
| 95 | } | 95 | } |
| 96 | out.shrink_to_fit(); | 96 | out.shrink_to_fit(); |
| 97 | out.sort_by(|a, b| { | 97 | out.sort_by(|a, b| { |
| 98 | a.1.email.cmp(b.1.email).then( | 98 | a.1.email |
| 99 | a.1.time | 99 | .cmp(b.1.email) |
| 100 | .seconds_since_unix_epoch | 100 | .then(a.1.time.seconds.cmp(&b.1.time.seconds).reverse()) |
| 101 | .cmp(&b.1.time.seconds_since_unix_epoch) | ||
| 102 | .reverse(), | ||
| 103 | ) | ||
| 104 | }); | 101 | }); |
| 105 | Ok(out) | 102 | Ok(out) |
| 106 | }); | 103 | }); |
| @@ -1,6 +1,7 @@ | |||
| 1 | pub(crate) mod function { | 1 | pub(crate) mod function { |
| 2 | use bstr::ByteSlice; | 2 | use bstr::ByteSlice; |
| 3 | use btoi::btoi; | 3 | use btoi::btoi; |
| 4 | use gix_date::{OffsetInSeconds, SecondsSinceUnixEpoch}; | ||
| 4 | use nom::{ | 5 | use nom::{ |
| 5 | branch::alt, | 6 | branch::alt, |
| 6 | bytes::complete::{tag, take, take_until, take_while_m_n}, | 7 | bytes::complete::{tag, take, take_until, take_while_m_n}, |
| @@ -25,7 +26,7 @@ pub(crate) mod function { · 18 unmodified lines | |||
| 25 | tag(b" "), | 26 | tag(b" "), |
| 26 | context("<timestamp>", |i| { | 27 | context("<timestamp>", |i| { |
| 27 | terminated(take_until(SPACE), take(1usize))(i).and_then(|(i, v)| { | 28 | terminated(take_until(SPACE), take(1usize))(i).and_then(|(i, v)| { |
| 28 | btoi::<u32>(v) | 29 | btoi::<SecondsSinceUnixEpoch>(v) |
| 29 | .map(|v| (i, v)) | 30 | .map(|v| (i, v)) |
| 30 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) | 31 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) |
| 31 | }) | 32 | }) |
| @@ -33,14 +34,14 @@ pub(crate) mod function { · 1 unmodified line | |||
| 33 | context("+|-", alt((tag(b"-"), tag(b"+")))), | 34 | context("+|-", alt((tag(b"-"), tag(b"+")))), |
| 34 | context("HH", |i| { | 35 | context("HH", |i| { |
| 35 | take_while_m_n(2usize, 2, is_digit)(i).and_then(|(i, v)| { | 36 | take_while_m_n(2usize, 2, is_digit)(i).and_then(|(i, v)| { |
| 36 | btoi::<i32>(v) | 37 | btoi::<OffsetInSeconds>(v) |
| 37 | .map(|v| (i, v)) | 38 | .map(|v| (i, v)) |
| 38 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) | 39 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) |
| 39 | }) | 40 | }) |
| 40 | }), | 41 | }), |
| 41 | context("MM", |i| { | 42 | context("MM", |i| { |
| 42 | take_while_m_n(2usize, 2, is_digit)(i).and_then(|(i, v)| { | 43 | take_while_m_n(2usize, 2, is_digit)(i).and_then(|(i, v)| { |
| 43 | btoi::<i32>(v) | 44 | btoi::<OffsetInSeconds>(v) |
| 44 | .map(|v| (i, v)) | 45 | .map(|v| (i, v)) |
| 45 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) | 46 | .map_err(|_| nom::Err::Error(E::from_error_kind(i, nom::error::ErrorKind::MapRes))) |
| 46 | }) | 47 | }) |
| @@ -58,8 +59,8 @@ pub(crate) mod function { · 11 unmodified lines | |||
| 58 | name: identity.name, | 59 | name: identity.name, |
| 59 | email: identity.email, | 60 | email: identity.email, |
| 60 | time: Time { | 61 | time: Time { |
| 61 | seconds_since_unix_epoch: time, | 62 | seconds: time, |
| 62 | offset_in_seconds: offset, | 63 | offset: offset, |
| 63 | sign, | 64 | sign, |
| 64 | }, | 65 | }, |
| 65 | }, | 66 | }, |
| @@ -93,6 +94,7 @@ pub use function::identity; · 27 unmodified lines | |||
| 93 | mod tests { | 94 | mod tests { |
| 94 | mod parse_signature { | 95 | mod parse_signature { |
| 95 | use bstr::ByteSlice; | 96 | use bstr::ByteSlice; |
| 97 | use gix_date::{OffsetInSeconds, SecondsSinceUnixEpoch}; | ||
| 96 | use gix_testtools::to_bstr_err; | 98 | use gix_testtools::to_bstr_err; |
| 97 | use nom::IResult; | 99 | use nom::IResult; |
| 98 | 100 | ||
| @@ -105,18 +107,14 @@ mod tests { · 6 unmodified lines | |||
| 105 | fn signature( | 107 | fn signature( |
| 106 | name: &'static str, | 108 | name: &'static str, |
| 107 | email: &'static str, | 109 | email: &'static str, |
| 108 | time: u32, | 110 | seconds: SecondsSinceUnixEpoch, |
| 109 | sign: Sign, | 111 | sign: Sign, |
| 110 | offset: i32, | 112 | offset: OffsetInSeconds, |
| 111 | ) -> SignatureRef<'static> { | 113 | ) -> SignatureRef<'static> { |
| 112 | SignatureRef { | 114 | SignatureRef { |
| 113 | name: name.as_bytes().as_bstr(), | 115 | name: name.as_bytes().as_bstr(), |
| 114 | email: email.as_bytes().as_bstr(), | 116 | email: email.as_bytes().as_bstr(), |
| 115 | time: Time { | 117 | time: Time { seconds, offset, sign }, |
| 116 | seconds_since_unix_epoch: time, | ||
| 117 | offset_in_seconds: offset, | ||
| 118 | sign, | ||
| 119 | }, | ||
| 120 | } | 118 | } |
| 121 | } | 119 | } |
| 122 | 120 | ||
| @@ -43,8 +43,8 @@ mod write_to { · 42 unmodified lines | |||
| 43 | 43 | ||
| 44 | fn default_time() -> Time { | 44 | fn default_time() -> Time { |
| 45 | Time { | 45 | Time { |
| 46 | seconds_since_unix_epoch: 0, | 46 | seconds: 0, |
| 47 | offset_in_seconds: 0, | 47 | offset: 0, |
| 48 | sign: Sign::Plus, | 48 | sign: Sign::Plus, |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| @@ -119,8 +119,8 @@ fn signature(name: &str, email: &str) -> gix_actor::Signature { · 118 unmodified lines | |||
| 119 | email: email.into(), | 119 | email: email.into(), |
| 120 | time: gix_actor::Time { | 120 | time: gix_actor::Time { |
| 121 | // marker | 121 | // marker |
| 122 | seconds_since_unix_epoch: 42, | 122 | seconds: 42, |
| 123 | offset_in_seconds: 53, | 123 | offset: 53, |
| 124 | sign: gix_actor::Sign::Minus, | 124 | sign: gix_actor::Sign::Minus, |
| 125 | }, | 125 | }, |
| 126 | } | 126 | } |
| @@ -139,8 +139,8 @@ fn with_trailer() -> crate::Result { · 138 unmodified lines | |||
| 139 | name: "Kim Altintop".into(), | 139 | name: "Kim Altintop".into(), |
| 140 | email: "kim@eagain.st".into(), | 140 | email: "kim@eagain.st".into(), |
| 141 | time: Time { | 141 | time: Time { |
| 142 | seconds_since_unix_epoch: 1631514803, | 142 | seconds: 1631514803, |
| 143 | offset_in_seconds: 7200, | 143 | offset: 7200, |
| 144 | sign: Sign::Plus, | 144 | sign: Sign::Plus, |
| 145 | }, | 145 | }, |
| 146 | }; | 146 | }; |
| @@ -236,8 +236,8 @@ mod summary { · 235 unmodified lines | |||
| 236 | name: "name".into(), | 236 | name: "name".into(), |
| 237 | email: "email".into(), | 237 | email: "email".into(), |
| 238 | time: Time { | 238 | time: Time { |
| 239 | seconds_since_unix_epoch: 0, | 239 | seconds: 0, |
| 240 | offset_in_seconds: 0, | 240 | offset: 0, |
| 241 | sign: Sign::Plus, | 241 | sign: Sign::Plus, |
| 242 | }, | 242 | }, |
| 243 | }; | 243 | }; |
| @@ -63,14 +63,14 @@ fn hex_to_id(hex: &str) -> ObjectId { · 62 unmodified lines | |||
| 63 | 63 | ||
| 64 | use gix_actor::{Sign, Time}; | 64 | use gix_actor::{Sign, Time}; |
| 65 | 65 | ||
| 66 | fn signature(time: u32) -> gix_actor::SignatureRef<'static> { | 66 | fn signature(seconds: u32) -> gix_actor::SignatureRef<'static> { |
| 67 | use gix_object::bstr::ByteSlice; | 67 | use gix_object::bstr::ByteSlice; |
| 68 | gix_actor::SignatureRef { | 68 | gix_actor::SignatureRef { |
| 69 | name: b"Sebastian Thiel".as_bstr(), | 69 | name: b"Sebastian Thiel".as_bstr(), |
| 70 | email: b"sebastian.thiel@icloud.com".as_bstr(), | 70 | email: b"sebastian.thiel@icloud.com".as_bstr(), |
| 71 | time: Time { | 71 | time: Time { |
| 72 | seconds_since_unix_epoch: time, | 72 | seconds, |
| 73 | offset_in_seconds: 28800, | 73 | offset: 28800, |
| 74 | sign: Sign::Plus, | 74 | sign: Sign::Plus, |
| 75 | }, | 75 | }, |
| 76 | } | 76 | } |
| @@ -82,8 +82,8 @@ fn linus_signature(time: u32) -> gix_actor::SignatureRef<'static> { · 5 unmodified lines | |||
| 82 | name: b"Linus Torvalds".as_bstr(), | 82 | name: b"Linus Torvalds".as_bstr(), |
| 83 | email: b"torvalds@linux-foundation.org".as_bstr(), | 83 | email: b"torvalds@linux-foundation.org".as_bstr(), |
| 84 | time: Time { | 84 | time: Time { |
| 85 | seconds_since_unix_epoch: time, | 85 | seconds: time, |
| 86 | offset_in_seconds: -25200, | 86 | offset: -25200, |
| 87 | sign: Sign::Minus, | 87 | sign: Sign::Minus, |
| 88 | }, | 88 | }, |
| 89 | } | 89 | } |
| @@ -239,8 +239,8 @@ cjHJZXWmV4CcRfmLsXzU8s2cR9A0DBvOxhPD1TlKC2JhBFXigjuL9U4Rbq9tdegB · 238 unmodified lines | |||
| 239 | name: b"Sebastian Thiel".as_bstr(), | 239 | name: b"Sebastian Thiel".as_bstr(), |
| 240 | email: b"byronimo@gmail.com".as_bstr(), | 240 | email: b"byronimo@gmail.com".as_bstr(), |
| 241 | time: gix_actor::Time { | 241 | time: gix_actor::Time { |
| 242 | seconds_since_unix_epoch: 1528473343, | 242 | seconds: 1528473343, |
| 243 | offset_in_seconds: offset, | 243 | offset: offset, |
| 244 | sign: gix_actor::Sign::Plus, | 244 | sign: gix_actor::Sign::Plus, |
| 245 | }, | 245 | }, |
| 246 | }), | 246 | }), |
| @@ -430,8 +430,8 @@ fn signature(time: u32) -> gix_actor::SignatureRef<'static> { · 429 unmodified lines | |||
| 430 | name: b"Sebastian Thiel".as_bstr(), | 430 | name: b"Sebastian Thiel".as_bstr(), |
| 431 | email: b"byronimo@gmail.com".as_bstr(), | 431 | email: b"byronimo@gmail.com".as_bstr(), |
| 432 | time: Time { | 432 | time: Time { |
| 433 | seconds_since_unix_epoch: time, | 433 | seconds: time, |
| 434 | offset_in_seconds: 7200, | 434 | offset: 7200, |
| 435 | sign: Sign::Plus, | 435 | sign: Sign::Plus, |
| 436 | }, | 436 | }, |
| 437 | } | 437 | } |
| @@ -225,8 +225,8 @@ pub mod decode { · 224 unmodified lines | |||
| 225 | name: b"name".as_bstr(), | 225 | name: b"name".as_bstr(), |
| 226 | email: b"foo@example.com".as_bstr(), | 226 | email: b"foo@example.com".as_bstr(), |
| 227 | time: Time { | 227 | time: Time { |
| 228 | seconds_since_unix_epoch: 1234567890, | 228 | seconds: 1234567890, |
| 229 | offset_in_seconds: 0, | 229 | offset: 0, |
| 230 | sign: Sign::Minus | 230 | sign: Sign::Minus |
| 231 | } | 231 | } |
| 232 | }, | 232 | }, |
| @@ -251,8 +251,8 @@ pub mod decode { · 18 unmodified lines | |||
| 251 | name: b"Sebastian Thiel".as_bstr(), | 251 | name: b"Sebastian Thiel".as_bstr(), |
| 252 | email: b"foo@example.com".as_bstr(), | 252 | email: b"foo@example.com".as_bstr(), |
| 253 | time: Time { | 253 | time: Time { |
| 254 | seconds_since_unix_epoch: 1618030561, | 254 | seconds: 1618030561, |
| 255 | offset_in_seconds: 28800, | 255 | offset: 28800, |
| 256 | sign: Sign::Plus, | 256 | sign: Sign::Plus, |
| 257 | }, | 257 | }, |
| 258 | }, | 258 | }, |
| @@ -54,8 +54,8 @@ fn missing_reflog_creates_it_even_if_similarly_named_empty_dir_exists_and_append · 53 unmodified lines | |||
| 54 | name: "committer".into(), | 54 | name: "committer".into(), |
| 55 | email: "committer@example.com".into(), | 55 | email: "committer@example.com".into(), |
| 56 | time: Time { | 56 | time: Time { |
| 57 | seconds_since_unix_epoch: 1234, | 57 | seconds: 1234, |
| 58 | offset_in_seconds: 1800, | 58 | offset: 1800, |
| 59 | sign: Sign::Plus, | 59 | sign: Sign::Plus, |
| 60 | }, | 60 | }, |
| 61 | }; | 61 | }; |
| @@ -33,8 +33,8 @@ pub(crate) mod prepare_and_commit { · 32 unmodified lines | |||
| 33 | name: "committer".into(), | 33 | name: "committer".into(), |
| 34 | email: "committer@example.com".into(), | 34 | email: "committer@example.com".into(), |
| 35 | time: Time { | 35 | time: Time { |
| 36 | seconds_since_unix_epoch: 1234, | 36 | seconds: 1234, |
| 37 | offset_in_seconds: 1800, | 37 | offset: 1800, |
| 38 | sign: Sign::Plus, | 38 | sign: Sign::Plus, |
| 39 | }, | 39 | }, |
| 40 | } | 40 | } |
| @@ -20,10 +20,7 @@ impl<'graph> LazyCommit<'graph> { · 19 unmodified lines | |||
| 20 | pub fn committer_timestamp(&self) -> Result<CommitterTimestamp, gix_object::decode::Error> { | 20 | pub fn committer_timestamp(&self) -> Result<CommitterTimestamp, gix_object::decode::Error> { |
| 21 | Ok(match &self.backing { | 21 | Ok(match &self.backing { |
| 22 | Either::Left(buf) => { | 22 | Either::Left(buf) => { |
| 23 | gix_object::CommitRefIter::from_bytes(buf) | 23 | gix_object::CommitRefIter::from_bytes(buf).committer()?.time.seconds as CommitterTimestamp |
| 24 | .committer()? | ||
| 25 | .time | ||
| 26 | .seconds_since_unix_epoch as CommitterTimestamp | ||
| 27 | } | 24 | } |
| 28 | Either::Right((cache, pos)) => cache.commit_at(*pos).committer_timestamp(), | 25 | Either::Right((cache, pos)) => cache.commit_at(*pos).committer_timestamp(), |
| 29 | }) | 26 | }) |
| @@ -53,7 +50,7 @@ impl<'graph> LazyCommit<'graph> { · 23 unmodified lines | |||
| 53 | Token::Parent { id } => parents.push(id), | 50 | Token::Parent { id } => parents.push(id), |
| 54 | Token::Author { .. } => {} | 51 | Token::Author { .. } => {} |
| 55 | Token::Committer { signature } => { | 52 | Token::Committer { signature } => { |
| 56 | timestamp = Some(signature.time.seconds_since_unix_epoch as CommitterTimestamp); | 53 | timestamp = Some(signature.time.seconds as CommitterTimestamp); |
| 57 | break; | 54 | break; |
| 58 | } | 55 | } |
| 59 | _ => { | 56 | _ => { |
| @@ -170,7 +170,7 @@ pub mod ancestors { · 169 unmodified lines | |||
| 170 | oid: commit_id, | 170 | oid: commit_id, |
| 171 | source: err.into(), | 171 | source: err.into(), |
| 172 | })?; | 172 | })?; |
| 173 | let time = commit_iter.committer()?.time.seconds_since_unix_epoch; | 173 | let time = commit_iter.committer()?.time.seconds; |
| 174 | match cutoff_time { | 174 | match cutoff_time { |
| 175 | Some(cutoff_time) if time >= cutoff_time => { | 175 | Some(cutoff_time) if time >= cutoff_time => { |
| 176 | state.queue.insert(time, commit_id); | 176 | state.queue.insert(time, commit_id); |
| @@ -383,12 +383,7 @@ pub mod ancestors { · 206 unmodified lines | |||
| 383 | 383 | ||
| 384 | let parent = (self.find)(id.as_ref(), &mut state.parents_buf).ok(); | 384 | let parent = (self.find)(id.as_ref(), &mut state.parents_buf).ok(); |
| 385 | let parent_commit_time = parent | 385 | let parent_commit_time = parent |
| 386 | .and_then(|parent| { | 386 | .and_then(|parent| parent.committer().ok().map(|committer| committer.time.seconds)) |
| 387 | parent | ||
| 388 | .committer() | ||
| 389 | .ok() | ||
| 390 | .map(|committer| committer.time.seconds_since_unix_epoch) | ||
| 391 | }) | ||
| 392 | .unwrap_or_default(); | 387 | .unwrap_or_default(); |
| 393 | 388 | ||
| 394 | match cutoff_older_than { | 389 | match cutoff_older_than { |
| @@ -91,7 +91,7 @@ pub mod describe { · 90 unmodified lines | |||
| 91 | let (prio, tag_time) = match target_id { | 91 | let (prio, tag_time) = match target_id { |
| 92 | Some(target_id) if peeled_id != *target_id => { | 92 | Some(target_id) if peeled_id != *target_id => { |
| 93 | let tag = repo.find_object(target_id).ok()?.try_into_tag().ok()?; | 93 | let tag = repo.find_object(target_id).ok()?.try_into_tag().ok()?; |
| 94 | (1, tag.tagger().ok()??.time.seconds_since_unix_epoch) | 94 | (1, tag.tagger().ok()??.time.seconds) |
| 95 | } | 95 | } |
| 96 | _ => (0, 0), | 96 | _ => (0, 0), |
| 97 | }; | 97 | }; |
| @@ -124,11 +124,7 @@ pub mod describe { · 26 unmodified lines | |||
| 124 | // TODO: we assume direct refs for tags, which is the common case, but it doesn't have to be | 124 | // TODO: we assume direct refs for tags, which is the common case, but it doesn't have to be |
| 125 | // so rather follow symrefs till the first object and then peel tags after the first object was found. | 125 | // so rather follow symrefs till the first object and then peel tags after the first object was found. |
| 126 | let tag = r.try_id()?.object().ok()?.try_into_tag().ok()?; | 126 | let tag = r.try_id()?.object().ok()?.try_into_tag().ok()?; |
| 127 | let tag_time = tag | 127 | let tag_time = tag.tagger().ok().and_then(|s| s.map(|s| s.time.seconds)).unwrap_or(0); |
| 128 | .tagger() | ||
| 129 | .ok() | ||
| 130 | .and_then(|s| s.map(|s| s.time.seconds_since_unix_epoch)) | ||
| 131 | .unwrap_or(0); | ||
| 132 | let commit_id = tag.target_id().ok()?.object().ok()?.try_into_commit().ok()?.id; | 128 | let commit_id = tag.target_id().ok()?.object().ok()?.try_into_commit().ok()?.id; |
| 133 | Some((commit_id, tag_time, Cow::<BStr>::from(r.name().shorten().to_owned()))) | 129 | Some((commit_id, tag_time, Cow::<BStr>::from(r.name().shorten().to_owned()))) |
| 134 | }) | 130 | }) |
| @@ -348,14 +348,14 @@ fn add_shallow_args( · 347 unmodified lines | |||
| 348 | args.deepen_relative(); | 348 | args.deepen_relative(); |
| 349 | } | 349 | } |
| 350 | Shallow::Since { cutoff } => { | 350 | Shallow::Since { cutoff } => { |
| 351 | args.deepen_since(cutoff.seconds_since_unix_epoch as usize); | 351 | args.deepen_since(cutoff.seconds as usize); |
| 352 | } | 352 | } |
| 353 | Shallow::Exclude { | 353 | Shallow::Exclude { |
| 354 | remote_refs, | 354 | remote_refs, |
| 355 | since_cutoff, | 355 | since_cutoff, |
| 356 | } => { | 356 | } => { |
| 357 | if let Some(cutoff) = since_cutoff { | 357 | if let Some(cutoff) = since_cutoff { |
| 358 | args.deepen_since(cutoff.seconds_since_unix_epoch as usize); | 358 | args.deepen_since(cutoff.seconds as usize); |
| 359 | } | 359 | } |
| 360 | for ref_ in remote_refs { | 360 | for ref_ in remote_refs { |
| 361 | args.deepen_not(ref_.as_ref().as_bstr()); | 361 | args.deepen_not(ref_.as_ref().as_bstr()); |
| @@ -126,7 +126,7 @@ pub(crate) fn update( · 125 unmodified lines | |||
| 126 | .try_into_commit() | 126 | .try_into_commit() |
| 127 | .map_err(|_| ()) | 127 | .map_err(|_| ()) |
| 128 | .and_then(|c| { | 128 | .and_then(|c| { |
| 129 | c.committer().map(|a| a.time.seconds_since_unix_epoch).map_err(|_| ()) | 129 | c.committer().map(|a| a.time.seconds).map_err(|_| ()) |
| 130 | }).and_then(|local_commit_time| | 130 | }).and_then(|local_commit_time| |
| 131 | remote_id | 131 | remote_id |
| 132 | .to_owned() | 132 | .to_owned() |
| @@ -48,8 +48,8 @@ fn author_and_committer_and_fallback() -> crate::Result { · 47 unmodified lines | |||
| 48 | name: "author".into(), | 48 | name: "author".into(), |
| 49 | email: "author@email".into(), | 49 | email: "author@email".into(), |
| 50 | time: gix_date::Time { | 50 | time: gix_date::Time { |
| 51 | seconds_since_unix_epoch: 1659329106, | 51 | seconds: 1659329106, |
| 52 | offset_in_seconds: 28800, | 52 | offset: 28800, |
| 53 | sign: gix_date::time::Sign::Plus | 53 | sign: gix_date::time::Sign::Plus |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| @@ -61,8 +61,8 @@ fn author_and_committer_and_fallback() -> crate::Result { · 5 unmodified lines | |||
| 61 | name: "committer".into(), | 61 | name: "committer".into(), |
| 62 | email: "committer@email".into(), | 62 | email: "committer@email".into(), |
| 63 | time: gix_date::Time { | 63 | time: gix_date::Time { |
| 64 | seconds_since_unix_epoch: 1659365106, | 64 | seconds: 1659365106, |
| 65 | offset_in_seconds: -7200, | 65 | offset: -7200, |
| 66 | sign: gix_date::time::Sign::Minus | 66 | sign: gix_date::time::Sign::Minus |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| @@ -167,8 +167,8 @@ fn author_from_different_config_sections() -> crate::Result { · 98 unmodified lines | |||
| 167 | name: "global name".into(), | 167 | name: "global name".into(), |
| 168 | email: "local@example.com".into(), | 168 | email: "local@example.com".into(), |
| 169 | time: gix_date::Time { | 169 | time: gix_date::Time { |
| 170 | seconds_since_unix_epoch: 42, | 170 | seconds: 42, |
| 171 | offset_in_seconds: 1800, | 171 | offset: 1800, |
| 172 | sign: gix_date::time::Sign::Plus | 172 | sign: gix_date::time::Sign::Plus |
| 173 | } | 173 | } |
| 174 | }), | 174 | }), |
| @@ -181,8 +181,8 @@ fn author_from_different_config_sections() -> crate::Result { · 6 unmodified lines | |||
| 181 | name: "local committer".into(), | 181 | name: "local committer".into(), |
| 182 | email: "global-committer@example.com".into(), | 182 | email: "global-committer@example.com".into(), |
| 183 | time: gix_date::Time { | 183 | time: gix_date::Time { |
| 184 | seconds_since_unix_epoch: 320437800, | 184 | seconds: 320437800, |
| 185 | offset_in_seconds: 0, | 185 | offset: 0, |
| 186 | sign: gix_date::time::Sign::Plus, | 186 | sign: gix_date::time::Sign::Plus, |
| 187 | } | 187 | } |
| 188 | }), | 188 | }), |