Re: [PATCH/RFC] git clone: is an URL local or ssh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday, October 26, 2013, Torsten Bögershausen wrote:
> diff --git a/connect.c b/connect.c
> index 06e88b0..903063e 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -564,9 +574,9 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
>         char *url;
>         char *host, *path;
>         char *end;
> -       int c;
> +       int seperator;

s/seperator/separator/g

>         struct child_process *conn = &no_fork;
> -       enum protocol protocol = PROTO_LOCAL;
> +       enum protocol protocol = PROTO_LOCAL_OR_SSH;
>         int free_path = 0;
>         char *port = NULL;
>         const char **arg;
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 1d1c875..69af007 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -294,39 +294,93 @@ test_expect_success 'setup ssh wrapper' '
>         export TRASH_DIRECTORY
>  '
>
> -clear_ssh () {
> -       >"$TRASH_DIRECTORY/ssh-output"
> -}
> -
> -expect_ssh () {
> +i6501=0

Is this variable meant to be named after the test script t5601? If so:
s/i6501/i5601/g

> +# $1 url
> +# $2 none|host
> +# $3 path
> +test_clone_url () {
> +       i6501=$(($i6501 + 1))
> +       >"$TRASH_DIRECTORY/ssh-output" &&
> +       test_might_fail git clone "$1" tmp$i6501 &&
>         {
> -               case "$1" in
> +               case "$2" in
>                 none)
>                         ;;
>                 *)
> -                       echo "ssh: $1 git-upload-pack '$2'"
> +                       echo "ssh: $2 git-upload-pack '$3'"
>                 esac
>         } >"$TRASH_DIRECTORY/ssh-expect" &&
> -       (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output)
> +       (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output) && {
> +               rm -rf ssh-expect ssh-output
> +       }

Should the 'rm' be inside the (cd...) subshell? If not, are the braces
wrapping 'rm' needed, and wouldn't you want to prefix the paths with
$TRASH_DIRECTORY/?

>  }
>
> -test_expect_success 'cloning myhost:src uses ssh' '
> -       clear_ssh &&
> -       git clone myhost:src ssh-clone &&
> -       expect_ssh myhost src
> -'
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]