Add tests for git_tree_walk

This tests the fixes for issues from #1849