summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-01-27 16:41:16 -0800
committerShawn O. Pearce <sop@google.com>2009-01-27 16:41:16 -0800
commitacda486cb5f0bda4c641d26dd6ed18263956af7a (patch)
tree5c30a15be2559629631b1f887d4144be0e01c388
parent5f5a123ff58c73cf49c44bc68733d7f1995aa3d7 (diff)
Push deletes to replicated repositories rather than fail
If a ref has been removed from the local repository but is in the push queue, the caller wants to remove it from the local repository and also from the replicated remotes. Rather than crash out with an IOException we now push the delete request. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--appjar/src/main/java/com/google/gerrit/git/PushQueue.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/appjar/src/main/java/com/google/gerrit/git/PushQueue.java b/appjar/src/main/java/com/google/gerrit/git/PushQueue.java
index b502e1dad9..cd6b733ebc 100644
--- a/appjar/src/main/java/com/google/gerrit/git/PushQueue.java
+++ b/appjar/src/main/java/com/google/gerrit/git/PushQueue.java
@@ -127,9 +127,12 @@ public class PushQueue {
continue;
}
+ // If the ref still exists locally, send it, else delete it.
+ //
+ final String srcexp = db.resolve(src) != null ? src : null;
final String dst = spec.getDestination();
final boolean force = spec.isForceUpdate();
- cmds.add(new RemoteRefUpdate(db, src, dst, force, null, null));
+ cmds.add(new RemoteRefUpdate(db, srcexp, dst, force, null, null));
}
} catch (IOException e) {
log.error("Cannot replicate " + op.projectName, e);