🏡 index : ~doyle/rgit.git

author Jordan Doyle <jordan@doyle.la> 2022-07-31 18:01:01.0 +01:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-07-31 18:01:01.0 +01:00:00
commit
97e09a301464ed08efeced2fe0119c3ac3fe1eb3 [patch]
tree
09c774a77dc693888a7840b1036146e03d3ac605
parent
acb7861cdadd24baa3d072b53f81344270b161f0
download
97e09a301464ed08efeced2fe0119c3ac3fe1eb3.tar.gz

Fix latest commit not appearing on log



Diff

 src/database/schema/commit.rs |  9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/database/schema/commit.rs b/src/database/schema/commit.rs
index 3abecb0..0495360 100644
--- a/src/database/schema/commit.rs
+++ a/src/database/schema/commit.rs
@@ -142,13 +142,8 @@
        };

        let end = latest_key.saturating_sub(offset);
        let start = end.saturating_sub(amount);
        let range = start.to_be_bytes()..end.to_be_bytes();
        let iter = if range.is_empty() {
            self.range(start.to_be_bytes()..=end.to_be_bytes())
        } else {
            self.range(range)
        };
        let start = end.saturating_sub(amount - 1);
        let iter = self.range(start.to_be_bytes()..=end.to_be_bytes());

        tokio::task::spawn_blocking(move || {
            iter.rev()