Fix: RefUpdate.delete does not prune empty directories
When the last loose ref (or reflog) is removed from a directory the
directory itself should also be removed, up to refs/{heads,tags,remotes}.
Otherwise we may fail when doing something like:
delete refs/heads/foo/bar
create refs/heads/foo
as refs/heads/foo is still a directory and cannot be a file.
http://code.google.com/p/egit/issues/detail?id=10
Signed-off-by: Charles O'Farrell <charleso@charleso.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>