Skip to content

Commit

Permalink
do not panic if invalid repo
Browse files Browse the repository at this point in the history
fixes #2064
  • Loading branch information
extrawurst committed Feb 20, 2024
1 parent 2bbaa6f commit a50a478
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ fn main() -> Result<()> {
asyncgit::register_tracing_logging();

if !valid_path(&cliargs.repo_path) {
bail!("invalid path\nplease run gitui inside of a non-bare git repository");
eprintln!("invalid path\nplease run gitui inside of a non-bare git repository");
return Ok(());
}

let key_config = KeyConfig::init()
Expand Down Expand Up @@ -318,7 +319,7 @@ fn draw(terminal: &mut Terminal, app: &App) -> io::Result<()> {
fn valid_path(repo_path: &RepoPath) -> bool {
let error = asyncgit::sync::repo_open_error(repo_path);
if let Some(error) = &error {
eprintln!("repo open error: {error}");
log::error!("repo open error: {error}");
}
error.is_none()
}
Expand Down

0 comments on commit a50a478

Please sign in to comment.