diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-07 10:28:29 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-07 10:28:29 -0400 |
commit | ae6db865961bca99f13cf6f5658c8265765d7b48 (patch) | |
tree | 5fd846816005980415f465cdd7fb75d2de5cf729 /src/main/java/com/gitblit/git/GitblitReceivePack.java | |
parent | e7bb5589b18b2bd176ef0cd152e0737c2f5dfa4c (diff) | |
parent | ce07c4f4ca47eebb53815aaa361a24ea46dc3757 (diff) | |
download | gitblit-ae6db865961bca99f13cf6f5658c8265765d7b48.tar.gz gitblit-ae6db865961bca99f13cf6f5658c8265765d7b48.zip |
Merge branch 'ticket/54' into develop
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;
|