diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-10-06 22:48:28 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-10-06 22:48:28 +0100 |
commit | 4c63ca3cd8ce471ec418d449397ac15454b363c5 (patch) | |
tree | 985dc1955445c1ca23442fc13127742a73f81737 /git.liw.fi.sh | |
parent | efe55deaf64fede11c56ac79207b875eef136974 (diff) | |
download | liw-gitano-acl-test-suite-4c63ca3cd8ce471ec418d449397ac15454b363c5.tar.gz |
Test repository removal
Diffstat (limited to 'git.liw.fi.sh')
-rw-r--r-- | git.liw.fi.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/git.liw.fi.sh b/git.liw.fi.sh index 304bfdb..1c52c2e 100644 --- a/git.liw.fi.sh +++ b/git.liw.fi.sh @@ -81,6 +81,32 @@ user_del() } +# Does a repository exist? + +repo_exists() +{ + run_gitano_as "$1" ls | awk -v "r=$2" '$NF == r' | grep . +} + + +# Clone repo over ssh. + +clone_with_ssh() +{ + localdir="$DATADIR/$1/$2" + rm -rf "$localdir" + mkdir -p "$localdir" + url="ssh://$GITANO@$GITHOST/$2" + if [ "$1" = admin ] + then + git clone "$url" "$localdir" + else + KEYFILE="$DATADIR/$1.key" \ + PATH="$SRCDIR:$PATH" git clone "$url" "$localdir" + fi +} + + # Remove a repository from the server. This is a two-step process. destroy_repo() |