These methods allows us overriding whole collections of specifications, saving unnecessary external code. Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx> --- .../org/spearce/jgit/transport/RemoteConfig.java | 24 ++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java index cde5d43..5b5e4d1 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java +++ b/org.spearce.jgit/src/org/spearce/jgit/transport/RemoteConfig.java @@ -267,6 +267,30 @@ public class RemoteConfig { } /** + * Override existing fetch specifications with new ones. + * + * @param specs + * list of fetch specifications to set. List is copied, it can be + * modified after this call. + */ + public void setFetchRefSpecs(final List<RefSpec> specs) { + fetch.clear(); + fetch.addAll(specs); + } + + /** + * Override existing push specifications with new ones. + * + * @param specs + * list of push specifications to set. List is copied, it can be + * modified after this call. + */ + public void setPushRefSpecs(final List<RefSpec> specs) { + push.clear(); + push.addAll(specs); + } + + /** * Remove a fetch RefSpec from this remote. * * @param s -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html