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";