]> source.dussan.org Git - gitblit.git/commitdiff
Added some logging for relinking HEAD
authorJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 00:14:06 +0000 (19:14 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 00:14:06 +0000 (19:14 -0500)
src/com/gitblit/GitBlit.java

index 721612632ef49e61cdc45183872ec591ee3634d7..9712ea6af087b39797a42d00bb7526e3d1a1920b 100644 (file)
@@ -984,10 +984,18 @@ public class GitBlit implements ServletContextListener {
                if (r != null) {\r
                        updateConfiguration(r, repository);\r
                        // only update symbolic head if it changes\r
-                       if (!StringUtils.isEmpty(repository.defaultHead) &&\r
-                                       !repository.defaultHead.equals(JGitUtils.getSymbolicHeadTarget(r))) {\r
+                       String currentHead = JGitUtils.getSymbolicHeadTarget(r);\r
+                       if (!StringUtils.isEmpty(repository.defaultHead)  &&\r
+                                       !repository.defaultHead.equals(currentHead)) {\r
+                               logger.info(MessageFormat.format("Relinking {0} HEAD from {1} to {2}", \r
+                                               repository.name, currentHead, repository.defaultHead));\r
                                JGitUtils.setSymbolicHeadTarget(r, repository.defaultHead);\r
+\r
+                               // clear the cache\r
+                               clearRepositoryCache(repository.name);\r
                        }\r
+\r
+                       // close the repository object\r
                        r.close();\r
                }\r
        }\r