diff options
Diffstat (limited to 'git-shell-commands')
-rwxr-xr-x | git-shell-commands/create-bare-repo | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo index 1e06580..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 "$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 |