projects
/
matthijs
/
servers
/
drsnuggles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b28063
)
git: Make the git-wrapper script a bit more readable.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 13 Aug 2009 09:43:38 +0000
(11:43 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 13 Aug 2009 09:46:23 +0000
(11:46 +0200)
usr/local/bin/git-wrapper
patch
|
blob
|
history
diff --git
a/usr/local/bin/git-wrapper
b/usr/local/bin/git-wrapper
index 43da4e1d77b1086a0472bb8950f26f7d6496874f..1920599af45e46adb61b37b7f83e9126804be48c 100755
(executable)
--- a/
usr/local/bin/git-wrapper
+++ b/
usr/local/bin/git-wrapper
@@
-10,6
+10,11
@@
BASE_PATH='/data/vcs/git'
BASE_PATH='/data/vcs/git'
+function init_repos() {
+ mkdir "$1" &> /dev/null || return 1
+ (cd $1 && git --bare init &> /dev/null) || return 1
+}
+
# We keep an array of arguments, so we can handle quoting an spaces in
# arguments properly.
ARGS=()
# We keep an array of arguments, so we can handle quoting an spaces in
# arguments properly.
ARGS=()
@@
-30,7
+35,7
@@
do
# When the client wants us to receive a pack, create the git
# repository if it does not exist yet
if [ "`basename $0`" = "git-receive-pack" -a ! -e "$DIR" ]; then
# When the client wants us to receive a pack, create the git
# repository if it does not exist yet
if [ "`basename $0`" = "git-receive-pack" -a ! -e "$DIR" ]; then
- mkdir "$DIR" &> /dev/null && (cd $DIR && git --bare init &> /dev/null)
+ init_repos "$DIR"
fi
ARGS[$i]="$DIR"
else
fi
ARGS[$i]="$DIR"
else