gitstats: Copied the test-lib.sh script from git.git/t