diff options
Diffstat (limited to 'git-shell-commands/create-bare-repo')
-rwxr-xr-x | git-shell-commands/create-bare-repo | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/git-shell-commands/create-bare-repo b/git-shell-commands/create-bare-repo index b4d2d5f..817ac1b 100755 --- a/git-shell-commands/create-bare-repo +++ b/git-shell-commands/create-bare-repo @@ -6,13 +6,13 @@ set -e for repo in "$@"; do - repo="$(sed -r 's,^/*,,' <<<"$repo")" - _repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" - test "$repo" != "$_repo" && { printf 'Illegal name: %s\n' "${repo}"; continue; } - test -d "$repo".git && { printf 'Already exists: %s\n' "${repo}"; continue; } + repo="$(sed -r 's,^/*,,' <<<"$repo")" + _repo="$(sed -r -e '/(^|\/)\.\.($|\/)/d' -e "s,[^A-Za-z0-9\./_~-],,g" <<<"$repo")" + test "$repo" != "$_repo" && { printf 'Illegal name: %s\n' "${repo}"; continue; } + test -d "$repo".git && { printf 'Already exists: %s\n' "${repo}"; continue; } - mkdir -p -- "$repo".git - pushd "$repo".git >/dev/null - git init --bare - popd >/dev/null + mkdir -p -- "$repo".git + pushd "$repo".git >/dev/null + git init --bare + popd >/dev/null done |