Skip to content

fix: resolve the remote URI using url.*.insteadOf#1394

Merged
sudoforge merged 1 commit intomasterfrom
Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8
Apr 30, 2025
Merged

fix: resolve the remote URI using url.*.insteadOf#1394
sudoforge merged 1 commit intomasterfrom
Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8

Conversation

@sudoforge
Copy link
Contributor

@sudoforge sudoforge commented Apr 29, 2025

This change introduces a new method for resolving the URI for a given
remote (by name), ensuring that the URI is rewritten following the rules
defined in url.*.insteadOf configuration.

When go-git@69aefb67315d775bf73df836b1e3ba5a3b321198 lands in a
release (and we update go-git to that release), this should be
refactored to use config.URL.InsteadOfs(), which supports multiple
url.*.insteadOf configuration blocks instead of the current limitation
of always taking the last definition.

Closes: #944
Change-Id: Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8

@sudoforge sudoforge enabled auto-merge April 29, 2025 23:37
@sudoforge sudoforge marked this pull request as draft April 30, 2025 00:50
auto-merge was automatically disabled April 30, 2025 00:50

Pull request was converted to draft

@MichaelMure
Copy link
Contributor

FYI, this kind of thing (calling the git binary) has been responsible for a CVE. I'd avoid it as much as possible.

@sudoforge
Copy link
Contributor Author

FYI, this kind of thing (calling the git binary) has been responsible for a CVE. I'd avoid it as much as possible.

yeah, i'm in the process of trying to make this work via go-git. i really don't like how half-baked it feels given that it's the "de facto" libgit2 implementation for golang.

@sudoforge sudoforge force-pushed the Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8 branch from e742ce3 to 973da59 Compare April 30, 2025 05:14
@sudoforge sudoforge changed the title fix: use the git cli to resolve remote URIs fix: resolve the remote URI using url.*.insteadOf Apr 30, 2025
@sudoforge sudoforge marked this pull request as ready for review April 30, 2025 05:14
@sudoforge sudoforge enabled auto-merge April 30, 2025 05:14
@sudoforge sudoforge force-pushed the Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8 branch from 973da59 to f96836c Compare April 30, 2025 05:28
This change introduces a new method for resolving the URI for a given
remote (by name), ensuring that the URI is rewritten following the rules
defined in `url.*.insteadOf` configuration.

When `go-git@69aefb67315d775bf73df836b1e3ba5a3b321198` lands in a
release (and we update go-git to that release), this should be
refactored to use `config.URL.InsteadOfs()`, which supports multiple
`url.*.insteadOf` configuration blocks instead of the current limitation
of always taking the last definition.

Closes: #944
Change-Id: Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8
@sudoforge sudoforge force-pushed the Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8 branch from f96836c to 8798018 Compare April 30, 2025 05:33
@sudoforge sudoforge disabled auto-merge April 30, 2025 14:36
@sudoforge sudoforge merged commit a150cdb into master Apr 30, 2025
16 checks passed
@sudoforge sudoforge deleted the Iffd111a1f4c42eff12613dcbd1b0d27df415f5e8 branch April 30, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"git bug push" fails with "Error: repository not found" when using insteadOf

2 participants