diff options
author | extrawurst <mail@rusticorn.com> | 2024-02-20 19:24:13 +0100 |
---|---|---|
committer | extrawurst <776816+extrawurst@users.noreply.github.com> | 2024-02-20 22:14:48 +0100 |
commit | a50a478c1a306a070c03898e5a2ec4d7d5567290 (patch) | |
tree | 88fd227df27b14c5816f031a63fef9b4db263cc4 /src | |
parent | 2bbaa6f3a196bf3bfd36b9724dfb74e076493893 (diff) |
do not panic if invalid repo
fixes #2064
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index f1810a3e..4531c6ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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() @@ -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() } |