summaryrefslogtreecommitdiffstats
path: root/src/tabs
diff options
context:
space:
mode:
authorextrawurst <mail@rusticorn.com>2023-03-01 13:48:38 +0100
committerextrawurst <776816+extrawurst@users.noreply.github.com>2023-03-01 14:22:42 +0100
commit2fa4c7932c50ecd0762da200e0187a4275ae264e (patch)
tree465cafecc79867858788ca8d77db5eaf9ed3ccab /src/tabs
parente1a40dd224f00d7c13f793f15cea3b8b13ae8912 (diff)
fix race issue in revlog message fetching
sometimes messages appear empty because getting the revlog is so fast (empty repo) that no draw happened yet and so we do not know yet what size the view will have. fixes #1473
Diffstat (limited to 'src/tabs')
-rw-r--r--src/tabs/revlog.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs
index b1faf69c..63a02cc3 100644
--- a/src/tabs/revlog.rs
+++ b/src/tabs/revlog.rs
@@ -160,7 +160,10 @@ impl Revlog {
let commits = sync::get_commits_info(
&self.repo.borrow(),
&self.git_log.get_slice(want_min, SLICE_SIZE)?,
- self.list.current_size().0.into(),
+ self.list
+ .current_size()
+ .map_or(100u16, |size| size.0)
+ .into(),
);
if let Ok(commits) = commits {