diff --git a/src/codegen/git/repo_operator/repo_operator.py b/src/codegen/git/repo_operator/repo_operator.py index edee45a18..f3bf2776f 100644 --- a/src/codegen/git/repo_operator/repo_operator.py +++ b/src/codegen/git/repo_operator/repo_operator.py @@ -897,8 +897,7 @@ def create_from_repo(cls, repo_path: str, url: str, access_token: str | None = N if local_head.hexsha == remote_head.hexsha: return cls(repo_config=RepoConfig.from_repo_path(repo_path), bot_commit=False, access_token=access_token) except Exception: - # If any git operations fail, fallback to fresh clone - pass + logger.exception("Failed to initialize Git repository. Falling back to fresh clone.") # If we get here, repo exists but is not up to date or valid # Remove the existing directory to do a fresh clone @@ -916,7 +915,6 @@ def create_from_repo(cls, repo_path: str, url: str, access_token: str | None = N # Initialize with the cloned repo git_cli = GitCLI(repo_path) except (GitCommandError, ValueError) as e: - logger.exception("Failed to initialize Git repository:") - logger.exception("Please authenticate with a valid token and ensure the repository is properly initialized.") + logger.exception("Failed to initialize Git repository") return None return cls(repo_config=RepoConfig.from_repo_path(repo_path), bot_commit=False, access_token=access_token)