feat: add Repository::reopen() as quick way to reload all configuration and drop caches.#2469
feat: add Repository::reopen() as quick way to reload all configuration and drop caches.#2469
Repository::reopen() as quick way to reload all configuration and drop caches.#2469Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR adds a Repository::reload() method that allows users to re-open a repository in place, refreshing all Git configuration from disk, dropping caches, and releasing system resources. It works by re-opening the repository using the stored open options with open_path_as_is(true) to avoid path discovery.
Changes:
- Added
reload(&mut self)method onRepositoryingix/src/repository/init.rsthat re-opens the repository from disk - Updated documentation on
config_snapshot()andconfig_snapshot_mut()to cross-reference the newreload()method - Added two tests verifying that
reload()picks up on-disk config changes and discards in-memory-only edits
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
gix/src/repository/init.rs |
New reload() method that re-opens the repository using stored options |
gix/src/repository/config/mod.rs |
Doc updates on config_snapshot() and config_snapshot_mut() referencing reload() |
gix/tests/gix/repository/config/config_snapshot/mod.rs |
Two new tests for reload(): on-disk changes and in-memory discard |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbb2e85b0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tion and drop caches. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
No description provided.