summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-12-17 00:12:04 +0100
committerAndrey Loskutov <loskutov@gmx.de>2015-12-28 10:56:21 +0100
commitc7c2897527659262cd4b6de0595eb2f369d8f724 (patch)
tree2924b1e919b53f5ca8d90774d9e76feefef6784d /org.eclipse.jgit.pgm.test/src/org/eclipse/jgit
parent9c71bf14b70240907ee880a18ba9977cb4e7bbdb (diff)
downloadjgit-c7c2897527659262cd4b6de0595eb2f369d8f724.tar.gz
jgit-c7c2897527659262cd4b6de0595eb2f369d8f724.zip
Allow checkout paths without specifying branch name
JGit CLI should allow to do this: checkout -- <path> Currently, even if "a" is a valid path in the git repo, jgit CLI can't checkout it: $jgit checkout -- a error: pathspec 'a' did not match any file(s) known to git. The fix also fixes at same time "unnamed" zombie "[VAL ...]" argument shown on the command line. Before fix: $jgit -h jgit checkout name [VAL ...] [-- path ... ...] [--force (-f)] [--help (-h)] [--orphan] [-b] After fix: $jgit -h jgit checkout [name] [-- path ... ...] [--force (-f)] [--help (-h)] [--orphan] [-b] Bug: 475765 Change-Id: I2b0e77959a72e4aac68452dc3846adaa745b0831 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
index 559a6d5d40..4bdfa4d5bc 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/lib/CLIRepositoryTestCase.java
@@ -46,6 +46,7 @@ import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@@ -76,6 +77,18 @@ public class CLIRepositoryTestCase extends LocalDiskRepositoryTestCase {
return result.toArray(new String[0]);
}
+ /**
+ * @param link
+ * the path of the symbolic link to create
+ * @param target
+ * the target of the symbolic link
+ * @return the path to the symbolic link
+ * @throws Exception
+ */
+ protected Path writeLink(String link, String target) throws Exception {
+ return JGitTestUtil.writeLink(db, link, target);
+ }
+
protected File writeTrashFile(final String name, final String data)
throws IOException {
return JGitTestUtil.writeTrashFile(db, name, data);