[EGIT PATCH 14/31] Add setFetchRefSpecs and setPushRefSpecs to RemoteConfig
- From
- Marek Zawirski <marek.zawirski@gmail.com>
- Date
- Aug 17, 2008, 20:43 UTC
- Message-ID
- <1219005852-21496-15-git-send-email-marek.zawirski@gmail.com>
- In-Reply-To
- <1219005852-21496-14-git-send-email-marek.zawirski@gmail.com>
These methods allows us overriding whole collections of specifications, saving unnecessary external code.
Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com> --- .../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