New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git: worktree, Support relative submodule URL. #184
Conversation
I'm not sure why only 1.14.x, macos-latest failed while others succeeded. Please let me know what you think about this PR. |
This is a feature supported by git? |
@mcuadros
|
This fix actually contains 2 bugs. First parentURL := filepath.Dir(origin[0].c.URLs[0]) produces a wrong parentURL in case you use https. The resulting URL will have the format http:/xyz... - so there is one slash missing because filepath.Dir() is removing it. The second issue is that multiple relative paths are not handled correctly - so ../../submodule.git will not work as well. As this PR is already merged new issues should be created. Will this be done by you guys? |
With the current behavior, the config will always hold the resolved, absolute URL, leavin the user of go-git no choice to determine whether the original URL is relative or not. This changes to employ relative URL resolution only when resolving a submodule to a repository to keep the correct configuration 'unresolved' and intact. Change relative resolution using `filepath.Dir` to `path.Join` while parsing both the 'root' and the relative URL with `net/url.URL`. Adapt test to verify the new behavior. Re-fixes go-git#184 (see comments).
need fix. any date? |
How i can get this fixes in my project? |
Original issue created by @tyru at src-d/go-git#737
This PR supports relative URLs in
.gitmodules
which refers to the superproject's remote origin.