git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	"peff@peff.net" <peff@peff.net>,
	"pclouds@gmail.com" <pclouds@gmail.com>
Subject: Re: [PATCH/RFC] git clone: is an URL local or ssh
Date: Sun, 27 Oct 2013 14:31:24 -0400	[thread overview]
Message-ID: <CAPig+cTCesnmj1z2H1ZkXAcRqZKQu-NLeLxfCYPYUZe45aadtQ@mail.gmail.com> (raw)
In-Reply-To: <201310262103.35770.tboegi@web.de>

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
> -'

      reply	other threads:[~2013-10-27 18:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 19:03 [PATCH/RFC] git clone: is an URL local or ssh Torsten Bögershausen
2013-10-27 18:31 ` Eric Sunshine [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPig+cTCesnmj1z2H1ZkXAcRqZKQu-NLeLxfCYPYUZe45aadtQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).