]> source.dussan.org Git - gitblit.git/commit
Fixed rename and delete repository (issue 10)
authorJames Moger <james.moger@gitblit.com>
Thu, 21 Jul 2011 01:06:17 +0000 (21:06 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 21 Jul 2011 01:06:17 +0000 (21:06 -0400)
commitdd6f08950e36694d9757adc84ed6805620d0c032
tree5b154f313150d7ff05048c8d2df46dbbccd2f62f
parent230632f582e7f1647cf15bc3ebd6148cb9af43c0
Fixed rename and delete repository (issue 10)

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.
src/com/gitblit/GitBlit.java