Skip to content

Commit a50a478

Browse files
committed
do not panic if invalid repo
fixes #2064
1 parent 2bbaa6f commit a50a478

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ fn main() -> Result<()> {
128128
asyncgit::register_tracing_logging();
129129

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

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

0 commit comments

Comments
 (0)