This unit test is not part of the suite since it requires firing up
gitblit, commiting, and stopping gitblit. This is the first step in
evolving unit testing of cloning/pushing.
If an object id was not specified Gitblit used HEAD to perform the
operation. This breaks under some conditions like working with a
repository that does not have any commits on master but does have
commits on a vcs-import branch.
The new approach is to centralize the resolution of unspecified object
ids to a common method which resolves HEAD first but uses the most
recently modified branch if HEAD points to nothing.
This commit also includes a non-functional method for creating an empty
branch. I couldn't figure out how to make JGit create an orphaned
branch.
Jetty 7.4.4 introduces a fix to correct url generation. Unfortunately,
this "fix" creates a bug for resolving the root page. Evidently the bug
may really be in Wicket.
Wicket Bug: WICKET-3841
Eclipse Bug: 351199
This was due to use of the FileResolver which caches repository objects.
Calling close() on a cached repository instance would decrement a
counter, but the repository would never really close and release all its
resources because the FileResolver "held" the first count/reference so
the object and refs databases were never closed.
The solution was to use reflection to determine the actual "useCnt" of
the repository and then call close() that number of times. In practice,
the "useCnt" is probably always 2, and that is the default value in case
reflection fails.