Fix git browsequery on directories.

At the moment you can't add a directory to a package if you're using git. This is because the cat-file command issued performing a browsequery without $commit is only valid for blobs, so trees are always assumed to have been deleted.

This fix defaults to HEAD as the $commit if none is provided.