Skip to content

feat(cli): add in-memory repository clone utility#6357

Open
sachin9058 wants to merge 6 commits intomindersec:mainfrom
sachin9058:feat/inmemory-repo-clone
Open

feat(cli): add in-memory repository clone utility#6357
sachin9058 wants to merge 6 commits intomindersec:mainfrom
sachin9058:feat/inmemory-repo-clone

Conversation

@sachin9058
Copy link
Copy Markdown
Contributor

Summary

Add a utility function to clone a git repository in memory using go-git.

This is a preparatory step toward improving the quickstart command to dynamically load rule and profile catalogs from a repository, as discussed in #6339.

The utility uses go-git with in-memory storage to avoid disk operations and provide a lightweight way to access repository contents.

No functional changes are introduced in this PR.

Fixes Part of #6339

Testing

  • Verified the CLI builds successfully:

  • go build ./cmd/cli

  • Ran all tests:

    go test ./...

  • Ran lint checks:

    make lint-fix

No behavior changes were introduced.

@sachin9058 sachin9058 requested a review from a team as a code owner April 13, 2026 15:18
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 13, 2026

Coverage Status

coverage: 59.542% (+0.003%) from 59.539% — sachin9058:feat/inmemory-repo-clone into mindersec:main

Copy link
Copy Markdown
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just roll this into the other clone PR, as this seems to either include a binary file (unreviewable) or only a single-line implementation?

Comment thread cli
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be checking in binary files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel worth building a separate file to wrap a one-line implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback!

I can inline the clone logic directly into the quickstart flow instead of introducing a separate helper and package.

I'll update the PR accordingly and remove the extra abstraction.

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.

3 participants