-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote: support remotes referred by URL only
When using git-push the user can set the upstream of a branch to a remote that is not present in the current repository by referring to its URL. In these cases, git checks for the validity of the URL itself instead of checking if a remote with that name exists locally. I.e.: $ git push --set-upstream <URL> This case affects lab mostly when we use the remote URL to lookup for it in GitLab: lab checks for the branch's remote name. `branch.<branch>.remote`, then it gets the remote URL itself; however, in this situation, the `branch.<branch>.remote` will be the URL already and any check for that remote in the local repository fails. The biggest problem is the amount of different URL formats supported by Git [1], which is bigger than the ones supported by the usual url.Parse() (net/url Go module). Because of that, I brought the git-urls module to help. This new module threat anything that isn't an external URL as a possible file URL, meaning that default remote names are also accepted, with that we can pass all our remote names (URL or not) to its Parse() function and just use the "path" component, which is pretty close to what we need for the GitLab lookup. [1] https://git-scm.com/docs/git-push#URLS Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
- Loading branch information
Showing
8 changed files
with
56 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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