#!/bin/sh -x

git version

echo "======== Setup ========"
git init foo

export GIT_AUTHOR_NAME="foo"
export GIT_AUTHOR_EMAIL="foo@example.com"
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL

cd foo

COMMIT1=$(git commit-tree $(git write-tree) -m "Commit 1")

export GIT_AUTHOR_NAME="bar"
export GIT_AUTHOR_EMAIL="bar@example.com"   

echo "Hello World" > file
git add file
COMMIT2=$(git commit-tree $(git write-tree) -m "Commit 2" -p $COMMIT1)

git branch -f master $COMMIT2
git log master --stat

echo "======== Bug: filter-branch --prune-empty not working ========"
git filter-branch --prune-empty master
git log master --stat

