From: Matthijs Kooijman Date: Thu, 13 Aug 2009 09:34:43 +0000 (+0200) Subject: git: Only create repositories for git-receive-pack. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fservers%2Fdrsnuggles.git;a=commitdiff_plain;h=3b28063ff56df163bced9bb9c0baf4b9b608e1eb git: Only create repositories for git-receive-pack. This prevents empty repositories from being created when a typo is made when fetching. --- diff --git a/usr/local/bin/git-wrapper b/usr/local/bin/git-wrapper index cd8f7c1..43da4e1 100755 --- 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"