summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2016-10-22 10:11:54 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2016-10-22 10:11:54 +0900
commit03046d0f60810ec01d830e6efb3291e4a161512a (patch)
tree45c5213bb43e7f0e8f265457cb6e5e47daae512e /org.eclipse.jgit/src
parente49025386eee85f4748b3f16ae2c63f6ff94f335 (diff)
downloadjgit-03046d0f60810ec01d830e6efb3291e4a161512a.tar.gz
jgit-03046d0f60810ec01d830e6efb3291e4a161512a.zip
CheckoutCommand: Add method to add multiple paths
The new method addPaths(List<String>) allows callers to add multiple paths without having to iterate over several calls to addPath(String). Change-Id: I2c3746a97ead7118fb0ed5543a2c843224719031 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
index 20d0704509..c17ae5c00d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
@@ -367,6 +367,26 @@ public class CheckoutCommand extends GitCommand<Ref> {
}
/**
+ * Add multiple slash-separated paths to the list of paths to check out. To
+ * check out all paths, use {@link #setAllPaths(boolean)}.
+ * <p>
+ * If this option is set, neither the {@link #setCreateBranch(boolean)} nor
+ * {@link #setName(String)} option is considered. In other words, these
+ * options are exclusive.
+ *
+ * @param p
+ * paths to update in the working tree and index (with
+ * <code>/</code> as separator)
+ * @return {@code this}
+ * @since 4.6
+ */
+ public CheckoutCommand addPaths(List<String> p) {
+ checkCallable();
+ this.paths.addAll(p);
+ return this;
+ }
+
+ /**
* Set whether to checkout all paths.
* <p>
* This options should be used when you want to do a path checkout on the