Skip to content

Conversation

@H3mul
Copy link

@H3mul H3mul commented Oct 8, 2025

Quick PR to support custom storage options when opening repo using git.PlainOpenWithOptions()

Would alleviate idiosyncracies like this one - having to replicate git.PlainOpen() logic just to pass KeepDescriptors: true:

https://github.com/sourcegraph/zoekt/blob/e1cef6f2b4dc40a2075839273a729c26f9a61c27/gitindex/index.go#L588-L591

Copilot AI review requested due to automatic review settings October 8, 2025 06:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for custom storage options to the PlainOpenOptions struct, allowing users to pass filesystem storage options when opening repositories using PlainOpenWithOptions(). This eliminates the need to replicate PlainOpen functionality just to pass custom storage configurations like KeepDescriptors: true.

  • Added StorageOptions field to PlainOpenOptions struct
  • Updated PlainOpenWithOptions to use NewStorageWithOptions instead of NewStorage
  • Added comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
options.go Added StorageOptions field to PlainOpenOptions struct and imported filesystem package
repository.go Modified PlainOpenWithOptions to use NewStorageWithOptions with the new storage options
repository_test.go Added test case to verify storage options are properly passed through

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@H3mul H3mul changed the title Add support for storage options to PlainOpenOptions Add support for storage options to PlainOpenWithOptions Oct 8, 2025
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.

1 participant