Fix git+file bug with non-current windows drives #1916
Merged
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.
When using a
git+file://
datasource on Windows, gomplate will fail to find file that are on non-current drives.e.g. when running on the
C:
drive, issuing commands like this will fail:C:\> gomplate -d config=git+file:///F:/myrepo ...
Turns out this is due to a known bug go-git/go-git#415, which is fixed (but not yet merged) in go-git/go-git#416.
I've forked the
go-git
repo, and cherry-picked the merge on top of the v5.10.0 tag, and will use that patched version in gomplate for now, until the upstream PR is merged.This "worked" previously because the URL was actually malformed in the associated test - it was sending
git+file://D:/tmp/...
which has a host reference toD:
, and a path of/tmp/...
. It was working in CI because the tmp dir is onD:
and the tests are run fromD:
as well.