[PATCH v2] dim: handle repo URLs ending with forward slash
Daniel Vetter
daniel at ffwll.ch
Wed Oct 24 15:57:46 UTC 2018
On Wed, Oct 24, 2018 at 03:22:08PM +0100, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Seems like some of my existing URLs had a trailing forward slash.
> This confused url_to_remote(), resulting in adding the exact same repo
> again.
>
> v2: consider only 0-1 trailing fwd slash (danvet)
>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
I think this is a bit clearer with its intention, at least for me :-)
Applied, thanks for your patch.
-Daniel
> ---
> dim | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 93e90a4f96d0..b4e63ef483a6 100755
> --- a/dim
> +++ b/dim
> @@ -192,7 +192,7 @@ function url_to_remote # url [url ...]
> fi
>
> for url; do
> - remote=$(git remote -v | grep -m 1 "$url (" | cut -f 1)
> + remote=$(git remote -v | grep -m 1 "$url/? (" | cut -f 1)
> if [[ -n "$remote" ]]; then
> echo "$remote"
> return 0
> --
> 2.19.1
>
> _______________________________________________
> dim-tools mailing list
> dim-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dim-tools
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dim-tools
mailing list