From d394d950100a97b7d73f0e162b64b0b8f3cef988 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 2 Feb 2012 19:14:06 -0500 Subject: [PATCH] Added some logging for relinking HEAD --- src/com/gitblit/GitBlit.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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(); } } -- 2.39.5