Repository navigation
fix(origin): a drive letter is only a drive on Windows - #6
Merged
Merged
Conversation
fileURIPath stripped the leading slash from file:///C:/tools.kpar on every system, so on Linux and macOS a directory named C: resolved relative to the project. The drive check is now Windows-only (windowsPaths), the Windows file:// spellings are documented, and the lock-rollback test runs on Windows by making the lock file read-only instead of skipping. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…rator Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
… host's separators Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
Summary
Follow-up to #5 for the three Devin Review findings on it.
fileURIPathstripped the leading slash fromfile:///C:/tools.kparon every system, so a directory namedC:(legal on POSIX) resolved relative to the project instead of/C:/tools.kpar. The drive check is nowisDrivePath=windowsPaths && drive.MatchString(...), withwindowsPaths = runtime.GOOS == "windows"as a package variable soTestDriveLetterFileURIsexercises both machines from one test file:TestPublishRollsBackWhenTheLockCannotBeWrittenno longer skips there. Windows ignores a read-only directory but refuses to replace a read-only file, so on Windows the test makes.project.lock.jsonitself0444andlock.Write's finalos.Renamefails afterlib/was published — the same rollback path, asserted with "Access is denied" instead of "permission denied".docs/packages.mdand the README name the Windows spellings (<vcs>+file:///C:/pathcanonical,<vcs>+file://C:/pathaccepted as input, same for a local.kpar/project directory) and state that/C:/pathis an ordinary directory elsewhere.Verified: full gate on Linux with
SYSPI_REQUIRE_VCS=1; the Windows branch of the rollback test is proven by this PR's Windows gate.