Fix creation of missing repository when replicating to a Gerrit server When replicating to a Gerrit server over http, non-existence of a repository is reported as: <repo-name> unavailable This message wasn't among expected messages and creation of the missing repository wasn't executed. Bug: Issue 11204 Change-Id: I3d6c3e14573b638b17d54d1777a606b8f356f1f9
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java index 9fe497b..5f0c066 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -343,7 +343,8 @@ String msg = e.getMessage(); if (msg.contains("access denied") || msg.contains("no such repository") - || msg.contains("Git repository not found")) { + || msg.contains("Git repository not found") + || msg.contains("unavailable")) { createRepository(); } else { repLog.error("Cannot replicate {}; Remote repository error: {}", projectName, msg);