Skip to content

Division by zero in progress indicator #7155

@botovq

Description

@botovq

When connecting to a slow git remote over ssh I occasionally briefly see NaN% show up. It looks like this:

$ jj git fetch --all-remotes
NaN% [

This is neither a big deal nor a real problem, but it would be nice to fix. I assume this is a result of GitProgress::to_progress() being called with self.total() == 0 which may warrant some special casing:

impl GitProgress {
fn to_progress(&self) -> Progress {
Progress {
bytes_downloaded: None,
overall: self.fraction() as f32 / self.total() as f32,
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions