Repository navigation
Resolve a relative --store path instead of aborting startup [patch] - #103
Merged
Merged
Conversation
The tool copied --store verbatim into GitLfsCache:Store:Root, and the options validator requires a fully qualified root, so `gitlfscache --store ./cache` failed at startup with an unhandled OptionsValidationException. The flag is now resolved against the working directory with Path.GetFullPath, the same way --config is. The validator's absolute-path rule is unchanged, so configuration files and environment variables stay strict for container deployments. Fixes #93 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Md2Tr7FWcbqPdwq2BjeG79
SonarCloud's new-code coverage gate counted the changed line in Main's command action as uncovered, since no test reached Main. Main is now internal and a test runs it with a relative --store and an invalid --upstream, which reads every flag and then exits 1 before a server starts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Md2Tr7FWcbqPdwq2BjeG79
|
This was referenced Oct 8, 2026
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.



Fixes #93
What was wrong
The tool copied
--storeverbatim intoGitLfsCache:Store:Root, and the options validator requires a fully qualified root. Sogitlfscache --store ./cache ..., the obvious way to run it locally, aborted at startup with an unhandledOptionsValidationExceptionand a stack trace.Change
Program.ResolveStoreRootresolves the flag withPath.GetFullPath, the same way--configis already handled.Tests
StoreFlagTests.Store_RelativeDirectory_ResolvesAgainstTheWorkingDirectory:./cacheresolves to<cwd>/cache, which is fully qualified. The test fails when the helper passes the value through unchanged, as the code did before.StoreFlagTests.Store_FullyQualifiedDirectory_IsKeptAsGiven: an absolute path is left alone.--port 5197 --store ./relcache --upstream stub=http://127.0.0.1:5199 --allow 'stub=**'). It started, created./relcache, and kept serving until it was stopped, with no stack trace.The full suite passes locally: 356 tests, 0 failed. The optional "catch
OptionsValidationExceptionand print plain lines" item is not included.🤖 Generated with Claude Code
https://claude.ai/code/session_01Md2Tr7FWcbqPdwq2BjeG79
Generated by Claude Code