summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanice Agustin <janice.agustin@ericsson.com>2015-01-30 09:54:33 -0500
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-10 21:06:48 +0000
commitff8e1ca415d9c8efb42939f7bb7fe4fb7319cc13 (patch)
tree742cf7456a18f5aba530d306bbb77591d25feee7
parentbbfec77a8878b3c51cedc9cf3f7acb2ca91a8af5 (diff)
Fix: Create missing repos when using git protocol
When using git protocol to replicate to a remote but there are missing repositories, the error thrown is a RemoteRepositoryException with the message "no such repository". Create the repository if this is detected. Change-Id: I920963f917e257ad5e889948419a8f78718e2b11 (cherry picked from commit 38c2a6b62ecc6fea9b41b1388c56f15ae760f3bb) Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java2
1 files changed, 1 insertions, 1 deletions
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 27a3901..04f1263 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java
@@ -275,7 +275,7 @@ class PushOne implements ProjectRunnable {
// does not exist. In this case NoRemoteRepositoryException is not
// raised.
final String msg = e.getMessage();
- if (msg.contains("access denied")) {
+ if (msg.contains("access denied") || msg.contains("no such repository")) {
createRepository();
} else {
log.error("Cannot replicate " + projectName