diff --git a/src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java b/src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java index 3c82205..643904d 100644 --- a/src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java +++ b/src/main/java/com/englishtown/bitbucket/hook/MirrorRepositoryHook.java @@ -4,9 +4,7 @@ import com.atlassian.bitbucket.concurrent.BucketedExecutor; import com.atlassian.bitbucket.concurrent.BucketedExecutorSettings; import com.atlassian.bitbucket.concurrent.ConcurrencyPolicy; import com.atlassian.bitbucket.concurrent.ConcurrencyService; -import com.atlassian.bitbucket.hook.repository.PostRepositoryHook; -import com.atlassian.bitbucket.hook.repository.PostRepositoryHookContext; -import com.atlassian.bitbucket.hook.repository.RepositoryHookRequest; +import com.atlassian.bitbucket.hook.repository.*; import com.atlassian.bitbucket.repository.Repository; import com.atlassian.bitbucket.scm.git.GitScm; import com.atlassian.bitbucket.scope.RepositoryScope; @@ -16,15 +14,13 @@ import com.atlassian.bitbucket.server.ApplicationPropertiesService; import com.atlassian.bitbucket.setting.Settings; import com.atlassian.bitbucket.setting.SettingsValidationErrors; import com.atlassian.bitbucket.setting.SettingsValidator; +import com.google.common.collect.ImmutableSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Nonnull; import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.TimeUnit; public class MirrorRepositoryHook implements PostRepositoryHook, SettingsValidator { @@ -40,6 +36,14 @@ public class MirrorRepositoryHook implements PostRepositoryHook TRIGGERS_TO_IGNORE = + ImmutableSet.of( + StandardRepositoryHookTrigger.UNKNOWN + ); + private final PasswordEncryptor passwordEncryptor; private final SettingsReflectionHelper settingsReflectionHelper; private final BucketedExecutor pushExecutor; @@ -72,11 +76,16 @@ public class MirrorRepositoryHook implements PostRepositoryHook map = new HashMap<>(); map.put(MirrorRepositoryHook.SETTING_MIRROR_REPO_URL, "");