summaryrefslogtreecommitdiff
path: root/git-shell-commands/create-bare-repo
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2013-09-11 01:37:48 -0300
committerNicolás Reynolds <fauno@endefensadelsl.org>2013-09-11 01:37:48 -0300
commit274e882c78f4e29820281608bd7c742dbf666717 (patch)
treedabf4d91f4b4ecdfc4a4c22253393a1b8dba0f57 /git-shell-commands/create-bare-repo
parentaf6871f6f4174f254e0ad6f00ccdaed9e68e4cb5 (diff)
parentae95c2980b8aa8459155381a6644027325c6385b (diff)
Merge branch 'delete-repo'
Diffstat (limited to 'git-shell-commands/create-bare-repo')
-rwxr-xr-xgit-shell-commands/create-bare-repo10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo
index 6c83bc6..a6e49e3 100755
--- a/git-shell-commands/create-bare-repo
+++ b/git-shell-commands/create-bare-repo
@@ -5,13 +5,13 @@
set -e
-for i in $@; do
+for repo in $@; do
# Cleanup names
- repo="`echo "$i" | sed "s/[^a-z0-9\._-]//gi"`"
+ repo="`echo "$repo" | sed -e "s,^[/\.]\+,,g" -e "s,[^a-z0-9\./_-],,gi"`"
+ test ! -d "$repo".git && continue
- if [ -z "$repo" ]; then continue; fi
-
- mkdir "$repo".git
+ mkdir -p "$repo".git
pushd "$repo".git
git init --bare
+ popd
done