diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-07 10:27:14 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-07 10:27:14 -0400 |
commit | ce07c4f4ca47eebb53815aaa361a24ea46dc3757 (patch) | |
tree | 0a4b7f171ff73c755f40c34dff6f411b65670ccf /src/main/java/com/gitblit/git/GitblitReceivePack.java | |
parent | 97b0bf20c5e95b6abc8500364773ff9897601b49 (diff) | |
download | gitblit-ce07c4f4ca47eebb53815aaa361a24ea46dc3757.tar.gz gitblit-ce07c4f4ca47eebb53815aaa361a24ea46dc3757.zip |
Ensure the repository model ref list is refreshed on ref creation or deletion
Diffstat (limited to 'src/main/java/com/gitblit/git/GitblitReceivePack.java')
-rw-r--r-- | src/main/java/com/gitblit/git/GitblitReceivePack.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/git/GitblitReceivePack.java b/src/main/java/com/gitblit/git/GitblitReceivePack.java index 61f2d67d..b4449f06 100644 --- a/src/main/java/com/gitblit/git/GitblitReceivePack.java +++ b/src/main/java/com/gitblit/git/GitblitReceivePack.java @@ -331,6 +331,8 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P return;
}
+ boolean isRefCreationOrDeletion = false;
+
// log ref changes
for (ReceiveCommand cmd : commands) {
@@ -339,9 +341,11 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P switch (cmd.getType()) {
case DELETE:
LOGGER.info(MessageFormat.format("{0} DELETED {1} in {2} ({3})", user.username, cmd.getRefName(), repository.name, cmd.getOldId().name()));
+ isRefCreationOrDeletion = true;
break;
case CREATE:
LOGGER.info(MessageFormat.format("{0} CREATED {1} in {2}", user.username, cmd.getRefName(), repository.name));
+ isRefCreationOrDeletion = true;
break;
case UPDATE:
LOGGER.info(MessageFormat.format("{0} UPDATED {1} in {2} (from {3} to {4})", user.username, cmd.getRefName(), repository.name, cmd.getOldId().name(), cmd.getNewId().name()));
@@ -355,6 +359,10 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P }
}
+ if (isRefCreationOrDeletion) {
+ gitblit.resetRepositoryCache(repository.name);
+ }
+
if (repository.useIncrementalPushTags) {
// tag each pushed branch tip
String emailAddress = user.emailAddress == null ? rp.getRefLogIdent().getEmailAddress() : user.emailAddress;
|