Skip to content

refactor: update git repository cloning mechanism. - #570

Merged
sng-asyncfunc merged 7 commits into
AsyncFuncAI:mainfrom
GdoongMathew:refactor/git_repo
Aug 10, 2026
Merged

refactor: update git repository cloning mechanism.#570
sng-asyncfunc merged 7 commits into
AsyncFuncAI:mainfrom
GdoongMathew:refactor/git_repo

Conversation

@GdoongMathew

Copy link
Copy Markdown
Collaborator

Summary

As an extension of the last PR #569.

  1. Using gitpython for git operation robustness.
  2. Split the original download_repo into dedicated implementation.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces subprocess-based cloning with provider-specific GitPython helpers while retaining shallow, single-branch clones and sanitizing clone failures.

  • Adds GitPython and its transitive dependencies.
  • Routes GitHub, GitLab, and Bitbucket clones through dedicated helpers.
  • Adds repository cloning, missing-Git, and credential-redaction tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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]
Loading

Reviews (7): Last reviewed commit: "Merge branch 'main' into refactor/git_re..." | Re-trigger Greptile

Comment thread api/repository.py
Comment thread api/repository.py Outdated
Comment thread api/repository.py Outdated
Comment thread api/repository.py Outdated
Comment thread api/repository.py Outdated
Comment thread api/repository.py Outdated
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@sng-asyncfunc
sng-asyncfunc merged commit 36b349d into AsyncFuncAI:main Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants