git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/7] Allow programs to not depend on remotes having urls

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
May 27, 2009, 18:42 UTC
Message-ID
<36ca99e90905271142q577f026bidffa1ae89714d2a5@mail.gmail.com>
In-Reply-To
<alpine.LNX.2.00.0905271408380.2147@iabervon.org>
Daniel,
I found a small typo.
Bert
On Wed, May 27, 2009 at 20:15, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 41 quoted lines
> For fetch and ls-remote, which use the first url of a remote, have
> transport_get() determine this by passing a remote and passing NULL
> for the url. For push, which uses every url of a remote, use each url
> in turn if there are any, and use NULL if there are none.
>
> This will allow the transport code to do something different if the
> location is not specified with a url.
>
> Also, have the message for a fetch say "foreign" if there is no url.
>
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
>  builtin-fetch.c     |   19 +++++++++++------
>  builtin-ls-remote.c |    4 +-
>  builtin-push.c      |   54 +++++++++++++++++++++++++++++++++-----------------
>  transport.c         |    3 ++
>  4 files changed, 52 insertions(+), 28 deletions(-)
>
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index 77acabf..bb1534a 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -341,12 +341,17 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
>                        what = rm->name;
>                }
>
> -               url_len = strlen(url);
> -               for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
> -                       ;
> -               url_len = i + 1;
> -               if (4 < i && !strncmp(".git", url + i - 3, 4))
> -                       url_len = i - 3;
> +               if (url) {
> +                       url_len = strlen(url);
> +                       for (i = url_len - 1; url[i] == '/' && 0 <= i; i--)
> +                               ;
> +                       url_len = i + 1;
> +                       if (4 < i && !strncmp(".git", url + i - 3, 4))
> +                               url_len = i - 3;
> +               } else {
> +                       url = "foriegn";
Typo.
Previous: Daniel Barkalow
Message 2 of 2 in “Allow programs to not depend on remotes having urls”
  1. 4/7 Allow programs to not depend on remotes having urlsDaniel Barkalow, May 27, 2009
  2. Bert WesargMay 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.