Skip to content

Commit c63a805

Browse files
committed
fix: remove duplicate git validation logic in exec module
- Remove redundant git validation block at lines 213-222 - Keep only the consolidated implementation that reuses git_repo_root result - Eliminates duplicate get_git_repo_root() calls for better performance - Maintains DRY principles and code quality - Addresses critical issue identified in merge commit 086980b Fixes: Duplicate code issue from merge conflict resolution
1 parent 086980b commit c63a805

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

codex-rs/exec/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,6 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
210210
}
211211
}
212212

213-
// If inside a git repo but with no commits, provide a clearer message.
214-
if !skip_git_repo_check
215-
&& get_git_repo_root(&config.cwd.to_path_buf()).is_some()
216-
&& !codex_core::git_info::git_repo_has_commits(&config.cwd).await
217-
{
218-
eprintln!(
219-
"This Git repository has no commits. Initialize it first:\n git add -A && git commit -m 'Initial commit'\nOr pass --skip-git-repo-check to bypass."
220-
);
221-
std::process::exit(1);
222-
}
223-
224213
let conversation_manager =
225214
ConversationManager::new(AuthManager::shared(config.codex_home.clone()));
226215

0 commit comments

Comments
 (0)