summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm.test/tst/org/eclipse
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-12-29 14:27:37 +0100
committerAndrey Loskutov <loskutov@gmx.de>2015-12-29 15:00:31 +0100
commitaabbc58341c2381a2c5907b82c50691a296ae6c9 (patch)
treeac3b3559c35a1ad3a17a9174c358ed08098e294c /org.eclipse.jgit.pgm.test/tst/org/eclipse
parent97b4c02cdaa3a62764a7407e1cab1b16d984d9de (diff)
downloadjgit-aabbc58341c2381a2c5907b82c50691a296ae6c9.tar.gz
jgit-aabbc58341c2381a2c5907b82c50691a296ae6c9.zip
Sort "eager" path-like options to the end of the help
The "--" path option (and all other similar options consuming all remaining arguments) should be placed at the end of the command line help. Currently jgit reset -h shows this: jgit reset [commit-ish] [path ... ...] [-- path ... ...] [--hard] [--help (-h)] [--mixed] [--soft] After the patch the help shows this: jgit reset [commit-ish] [path ... ...] [--hard] [--help (-h)] [--mixed] [--soft] [-- path ... ...] Bug: 484951 Change-Id: I3db332bf293ca8d6bfaab0d546cd35af689bd46e Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java7
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java8
2 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
index 8cdd45ac7b..16c5889c48 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ResetTest.java
@@ -63,6 +63,13 @@ public class ResetTest extends CLIRepositoryTestCase {
}
@Test
+ public void testPathOptionHelp() throws Exception {
+ String[] result = execute("git reset -h");
+ assertTrue("Unexpected argument: " + result[1],
+ result[1].endsWith("[-- path ... ...]"));
+ }
+
+ @Test
public void testZombieArgument_Bug484951() throws Exception {
String[] result = execute("git reset -h");
assertFalse("Unexpected argument: " + result[0],
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
index 854c52d88b..368047c602 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/StatusTest.java
@@ -44,6 +44,7 @@ package org.eclipse.jgit.pgm;
import static org.eclipse.jgit.lib.Constants.MASTER;
import static org.eclipse.jgit.lib.Constants.R_HEADS;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
@@ -56,6 +57,13 @@ import org.junit.Test;
public class StatusTest extends CLIRepositoryTestCase {
@Test
+ public void testPathOptionHelp() throws Exception {
+ String[] result = execute("git status -h");
+ assertTrue("Unexpected argument: " + result[1],
+ result[1].endsWith("[-- path ... ...]"));
+ }
+
+ @Test
public void testStatusDefault() throws Exception {
executeTest("git status", false, true);
}