This prevents empty repositories from being created when a typo is made
when fetching.
- # 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"
mkdir "$DIR" &> /dev/null && (cd $DIR && git --bare init &> /dev/null)
fi
ARGS[$i]="$DIR"