From 3b28063ff56df163bced9bb9c0baf4b9b608e1eb Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 13 Aug 2009 11:34:43 +0200 Subject: [PATCH] git: Only create repositories for git-receive-pack. This prevents empty repositories from being created when a typo is made when fetching. --- usr/local/bin/git-wrapper | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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" -- 2.30.2