Re: [PATCH v5 2/3] remote: name the original URL when relative_url() fails
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 1, 2026, 12:35 UTC
- Message-ID
- <aw6-9XJ5kPVyxYUv@pks.im>
- In-Reply-To
- <20261126115803.30015-3-aniketgupta3001@gmail.com>
On Thu, Nov 26, 2026 at 05:28:02PM +0530, Aniket Gupta wrote:
Show 13 quoted lines
> diff --git a/remote.c b/remote.c
> index 3bca10364e..25e607abf2 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -3183,7 +3183,7 @@ char *relative_url_gently(const char *remote_url, const char *url,
> if (chopped < 0) {
> strbuf_addf(err,
> _("cannot strip one component off url '%s'"),
> - remoteurl);
> + remote_url);
> free(remoteurl);
> strbuf_release(&sb);
> return NULL;This code is just plain ugly. It's no surprise that one might confuse the two variables when one is called `remote_url` and one is called `remoteurl`. How am I supposed to figure out what the difference is between those two?
Anyway, that's not a problem you introduced. It might've made sense to include another patch on top that renames e.g. `remote_url` to `full_remote_url`, but you don't have to.
Patrick