refactor: update git repository cloning mechanism. - #570
Merged
Conversation
Greptile SummaryThe PR replaces subprocess-based cloning with provider-specific GitPython helpers while retaining shallow, single-branch clones and sanitizing clone failures.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| api/repository.py | Replaces the monolithic subprocess clone operation with provider-specific GitPython helpers, shallow-clone options, and centralized error sanitization; previously reported defects are no longer present. |
| tests/test_repository.py | Adds coverage for local and remote repository detection, missing Git, successful cloning, token masking, and network clones. |
| api/pyproject.toml | Adds GitPython as a runtime dependency. |
| api/poetry.lock | Locks GitPython and its gitdb and smmap transitive dependencies. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Repo.download] --> B{Repository type}
B -->|GitHub| C[_clone_from_github]
B -->|GitLab| D[_clone_from_gitlab]
B -->|Bitbucket| E[_clone_from_bitbucket]
B -->|Unknown| F[NotImplementedError]
C --> G[GitRepo.clone_from]
D --> G
E --> G
G -->|GitCommandError| H[_exception_cleanup]
H --> I[Redacted ValueError]
Reviews (7): Last reviewed commit: "Merge branch 'main' into refactor/git_re..." | Re-trigger Greptile
# Conflicts: # api/poetry.lock # api/repository.py
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As an extension of the last PR #569.
gitpythonfor git operation robustness.download_repointo dedicated implementation.