Skip to content

Commit

Permalink
Automated pre-commit update
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] authored and github-actions[bot] committed Feb 25, 2025
1 parent 45ab6e1 commit bfa8fc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/codegen/sdk/core/codebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,10 @@ def checkout(self, *, commit: str | GitCommit | None = None, branch: str | None
self._num_ai_requests = 0
self.reset_logs()
self.ctx.undo_applied_diffs()

# Stash changes to preserve .gitignore'd files
self.stash_changes()

if commit is None:
assert branch is not None, "Commit or branch must be specified"
logger.info(f"Checking out branch {branch}")
Expand All @@ -847,16 +847,16 @@ def checkout(self, *, commit: str | GitCommit | None = None, branch: str | None
assert branch is None, "Cannot specify branch and commit"
logger.info(f"Checking out commit {commit}")
result = self._op.checkout_commit(commit_hash=commit)

if result == CheckoutResult.SUCCESS:
logger.info(f"Checked out {branch or commit}")
self.sync_to_commit(self._op.head_commit)

# Restore stashed changes to bring back .gitignore'd files
self.restore_stashed_changes()
elif result == CheckoutResult.NOT_FOUND:
logger.info(f"Could not find branch {branch or commit}")

# Restore stashed changes even if checkout failed
self.restore_stashed_changes()

Expand Down

0 comments on commit bfa8fc5

Please sign in to comment.