felipec/git — pull request #12 by buchuki (2012-12-28 04:57:12+00:00)
Title: When pushing a named branch ref, make sure that the commit gets pushed to the appropriate branch

I'm submitting this for review. It seems to address both #7 and #9, from my perspective, but I'm not certain it does not introduce incompatible changes to other aspects. Also, this commit does not provide a test, but the following bash script worked for me:

```bash
rm -rf gitclone/ upstream/
mkdir upstream
cd upstream
hg init .
echo a > a
hg add a
hg commit -m "a"
hg branch b
echo b > b
hg add b
hg commit -m "b"
hg update a
cd ..
git clone hg::/home/dusty/test/upstream gitclone
cd gitclone
git checkout -f branches/b
echo c > c
git add c
git commit -m "c"
git push origin branches/b
git checkout -b branches/d
echo d > d
git add d
git commit -m "d"
git push origin branches/d
cd ../upstream
git log
# Visually check that the b, c and d commits are on branch b
```