summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTomasz Zarna2012-11-11 17:43:38 (EST)
committer Chris Aniszczyk2012-11-15 18:45:35 (EST)
commit074f9194dc5c4ad4987f7ec6f956c7da7d80702c (patch)
tree82aa97e6b4d27e0e37e65b0819b19fd19e577c69
parente73c6873c7a770e8b102819c41fed0715d07dd62 (diff)
downloadjgit-074f9194dc5c4ad4987f7ec6f956c7da7d80702c.zip
jgit-074f9194dc5c4ad4987f7ec6f956c7da7d80702c.tar.gz
jgit-074f9194dc5c4ad4987f7ec6f956c7da7d80702c.tar.bz2
Prefix an abnormal CLI command termination with 'fatal:'refs/changes/33/8633/2
Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
-rw-r--r--org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java4
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java2
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java4
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java1
5 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
index 78e752d..982aa95 100644
--- a/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
+++ b/org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.pgm;
import java.io.ByteArrayOutputStream;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -91,7 +92,8 @@ public class CLIGitCommand {
cmd.execute(bean.getArguments().toArray(
new String[bean.getArguments().size()]));
} catch (Die e) {
- return IO.readLines(e.getMessage());
+ return IO.readLines(MessageFormat.format(CLIText.get().fatalError,
+ e.getMessage()));
} finally {
if (cmd.outw != null)
cmd.outw.flush();
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java
index 900164e..5193aaa 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java
@@ -65,7 +65,7 @@ public class BranchTest extends CLIRepositoryTestCase {
@Test
public void testExistingBranch() throws Exception {
- assertEquals("A branch named 'master' already exists.",
+ assertEquals("fatal: A branch named 'master' already exists.",
execute("git branch master")[0]);
}
}
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
index 33cfb9a..d7b91cc 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
@@ -83,13 +83,13 @@ public class CheckoutTest extends CLIRepositoryTestCase {
public void testCheckoutNewBranchThatAlreadyExists() throws Exception {
new Git(db).commit().setMessage("initial commit").call();
- assertEquals("A branch named 'master' already exists.",
+ assertEquals("fatal: A branch named 'master' already exists.",
execute("git checkout -b master"));
}
@Test
public void testCheckoutNewBranchOnBranchToBeBorn() throws Exception {
- assertEquals("You are on a branch yet to be born",
+ assertEquals("fatal: You are on a branch yet to be born",
execute("git checkout -b side"));
}
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
index 8bbcf5e..bf95ab3 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties
@@ -53,7 +53,6 @@ failedToCommitIndex=failed to commit index
failedToLockIndex=failed to lock index
failedToLockTag=Failed to lock tag {0}: {1}
fatalError=fatal: {0}
-fatalErrorTagExists=fatal: tag '{0}' exists
fatalThisProgramWillDestroyTheRepository=fatal: This program will destroy the repository\nfatal:\nfatal:\nfatal: {0}\nfatal:\nfatal: To continue, add {1} to the command line\nfatal:
fileIsRequired=argument file is required
forcedUpdate=forced update
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
index b2f7cba..62d772d 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
@@ -120,7 +120,6 @@ public class CLIText extends TranslationBundle {
/***/ public String failedToLockIndex;
/***/ public String failedToLockTag;
/***/ public String fatalError;
- /***/ public String fatalErrorTagExists;
/***/ public String fatalThisProgramWillDestroyTheRepository;
/***/ public String fileIsRequired;
/***/ public String forcedUpdate;