progrium/gitreceive

Piping code to directory adds low-level git files/folders

audleman opened this issue · 2 comments

When I use the mkdir -p /some/path && cat | tar -x -C /some/path command specified in the documentation I get an unexpected result. My code is in place, but at the root of my project I also get

drwxr-xr-x  2 git git  4096 2014-05-31 20:44 branches
-rw-r--r--  1 git git    66 2014-05-31 20:44 config
-rw-r--r--  1 git git    73 2014-05-31 20:44 description
-rw-r--r--  1 git git    23 2014-05-31 20:44 HEAD
drwxr-xr-x  2 git git  4096 2014-05-31 20:44 hooks
drwxr-xr-x  2 git git  4096 2014-05-31 20:44 info

...and a few more. i.e. some low-level git info that I'm not used to seeing in my repo.

Is this expected behavior or did I do something wrong? I don't see that it'll do any harm, but I'm always a bit spooked by the unexpected while coding.

Thanks, and great project!

Is that command the only content of your receiver script?

Nope, full script below:

#!/bin/bash
mkdir -p /home/git/dice && cat | tar -x -C /home/git/dice
cd /home/git/dice
echo "----> Setting up virtualenv ..."
virtualenv venv
source venv/bin/activate
echo "----> Installing requirements.txt ..."
pip install -r requirements.txt

URL=http://requestb.in/1idyodf1
echo "----> Posting to $URL ..."
curl \
  -X 'POST' \
  -F "repository=$1" \
  -F "revision=$2" \
  -F "username=$3" \
  -F "fingerprint=$4" \
  -F contents=@- \
  --silent $URL