summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2013-09-11 01:27:16 -0300
committerNicolás Reynolds <fauno@endefensadelsl.org>2013-09-11 01:27:16 -0300
commit34b2ef6f3896d54436c24282c39145c5ee5c45c9 (patch)
treeb9df4297cb17122af2bc132bd6a6523cdbb8978d
parente731c2a87859cb97aa091b11589c63a6b7f5a12e (diff)
A bit more secure
-rwxr-xr-xgit-shell-commands/delete-repo3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-shell-commands/delete-repo b/git-shell-commands/delete-repo
index 17804c6..075f77a 100755
--- a/git-shell-commands/delete-repo
+++ b/git-shell-commands/delete-repo
@@ -6,8 +6,11 @@
set -e
for repo in $@; do
+# Remove leading slashes and dots and perform cleanup
+ repo="`echo "$repo" | sed -e "s,^[/\.]\+,,g" -e "s,[^a-z0-9\./_-],,gi"`"
test ! -d "$repo".git && continue
+ echo "Removing ${repo}.git"
# lo and behold absolute horror
rm -rf "$repo".git
done