From: James Moger Date: Fri, 3 Feb 2012 00:14:06 +0000 (-0500) Subject: Added some logging for relinking HEAD X-Git-Tag: v0.9.0~116 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d394d950100a97b7d73f0e162b64b0b8f3cef988;p=gitblit.git Added some logging for relinking HEAD --- diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 72161263..9712ea6a 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -984,10 +984,18 @@ public class GitBlit implements ServletContextListener { if (r != null) { updateConfiguration(r, repository); // only update symbolic head if it changes - if (!StringUtils.isEmpty(repository.defaultHead) && - !repository.defaultHead.equals(JGitUtils.getSymbolicHeadTarget(r))) { + String currentHead = JGitUtils.getSymbolicHeadTarget(r); + if (!StringUtils.isEmpty(repository.defaultHead) && + !repository.defaultHead.equals(currentHead)) { + logger.info(MessageFormat.format("Relinking {0} HEAD from {1} to {2}", + repository.name, currentHead, repository.defaultHead)); JGitUtils.setSymbolicHeadTarget(r, repository.defaultHead); + + // clear the cache + clearRepositoryCache(repository.name); } + + // close the repository object r.close(); } }