From 220398e823a45ea3cd3049a1b6799a8c3db8492d Mon Sep 17 00:00:00 2001 From: Per Cederqvist <cederp@opera.com> Date: Wed, 18 Apr 2012 10:32:45 +0200 Subject: [PATCH] Added --use-ssh option to the setup script. --- stdout.master.3.txt | 1 + stdout.mirror.3.txt | 1 + test-git-reclone.sh | 11 ++++++++++- test-git-setup.sh | 13 +++++++++++-- 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 stdout.master.3.txt create mode 100644 stdout.mirror.3.txt diff --git a/stdout.master.3.txt b/stdout.master.3.txt new file mode 100644 index 0000000..d69c690 --- /dev/null +++ b/stdout.master.3.txt @@ -0,0 +1 @@ +Cloning into 'master-clone'... diff --git a/stdout.mirror.3.txt b/stdout.mirror.3.txt new file mode 100644 index 0000000..3f5afca --- /dev/null +++ b/stdout.mirror.3.txt @@ -0,0 +1 @@ +Cloning into 'mirror-clone'... diff --git a/test-git-reclone.sh b/test-git-reclone.sh index 3602773..0cc66d9 100755 --- a/test-git-reclone.sh +++ b/test-git-reclone.sh @@ -12,9 +12,18 @@ esac good=0 cd test-git || exit 1 rm -rf $what-clone + +if [ -f use_ssh ] +then + use_ssh=ssh://localhost/`pwd`/ +else + use_ssh= +fi + + while : do - git clone $what.git $what-clone >$what.out 2>$what.err || exit 1 + git clone ${use_ssh}$what.git $what-clone >$what.out 2>$what.err || exit 1 if [ -s $what.err ] then echo unexpected stderr from git clone: diff --git a/test-git-setup.sh b/test-git-setup.sh index 6e4c58c..5e13df6 100755 --- a/test-git-setup.sh +++ b/test-git-setup.sh @@ -1,12 +1,21 @@ #!/bin/sh mkdir test-git || exit 1 cd test-git + +if [ x"$1" = x"--use-ssh" ] +then + touch use_ssh + use_ssh=ssh://localhost/`pwd`/ +else + use_ssh= +fi + mkdir master.git (cd master.git && git init --bare) -git clone master.git committer +git clone ${use_ssh}master.git committer (cd committer && touch foo && git add foo && git commit -m"Initial commit" && git push origin master) -git clone --mirror master.git mirror.git +git clone --mirror ${use_ssh}master.git mirror.git -- GitLab