Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/codegen/git/repo_operator/repo_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)