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:
72f5c5e
)
git: Only create repositories for git-receive-pack.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 13 Aug 2009 09:34:43 +0000
(11:34 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 13 Aug 2009 09:34:43 +0000
(11:34 +0200)
This prevents empty repositories from being created when a typo is made
when fetching.
usr/local/bin/git-wrapper
patch
|
blob
|
history
diff --git
a/usr/local/bin/git-wrapper
b/usr/local/bin/git-wrapper
index cd8f7c1d4a11cc2ede3ddd724b7cbfab261a08b9..43da4e1d77b1086a0472bb8950f26f7d6496874f 100755
(executable)
--- a/
usr/local/bin/git-wrapper
+++ b/
usr/local/bin/git-wrapper
@@
-27,8
+27,9
@@
do
DIR="$BASE_PATH/$DIR"
fi
- # Create the git repository if it does not exist yet
- if [ ! -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)
fi
ARGS[$i]="$DIR"