fix: is_inside_git_repo should take the directory as a param (#809)
https://github.com/openai/codex/pull/800 made `cwd` a property of `Config` and made it so the `cwd` is not necessarily `std::env::current_dir()`. As such, `is_inside_git_repo()` should check `Config.cwd` rather than `std::env::current_dir()`. This PR updates `is_inside_git_repo()` to take `Config` instead of an arbitrary `PathBuf` to force the check to operate on a `Config` where `cwd` has been resolved to what the user specified.
This commit is contained in:
@@ -114,7 +114,7 @@ pub fn run_main(cli: Cli) -> std::io::Result<()> {
|
||||
// modal. The flag is shown when the current working directory is *not*
|
||||
// inside a Git repository **and** the user did *not* pass the
|
||||
// `--allow-no-git-exec` flag.
|
||||
let show_git_warning = !cli.skip_git_repo_check && !is_inside_git_repo();
|
||||
let show_git_warning = !cli.skip_git_repo_check && !is_inside_git_repo(&config);
|
||||
|
||||
try_run_ratatui_app(cli, config, show_git_warning, log_rx);
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user