Fix: RefUpdate.delete does not prune empty directories
commitf80559d3e04365142364b33374971ca38d906a64
authorCharles O'Farrell <charleso@charleso.org>
Fri, 5 Sep 2008 22:56:47 +0000 (6 08:56 +1000)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 6 Sep 2008 05:18:14 +0000 (5 22:18 -0700)
tree445ba781a52fd51a13074b4c79311083c387bb74
parentfb934847ffaf91d1b2b57e3a74ac2f9b345d1db2
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>
org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java