diff options
author | Tomasz Zarna <tomasz.zarna@tasktop.com> | 2012-11-11 23:43:38 +0100 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2012-11-15 15:45:35 -0800 |
commit | 074f9194dc5c4ad4987f7ec6f956c7da7d80702c (patch) | |
tree | 82aa97e6b4d27e0e37e65b0819b19fd19e577c69 /org.eclipse.jgit.pgm.test | |
parent | e73c6873c7a770e8b102819c41fed0715d07dd62 (diff) | |
download | jgit-074f9194dc5c4ad4987f7ec6f956c7da7d80702c.tar.gz jgit-074f9194dc5c4ad4987f7ec6f956c7da7d80702c.zip |
Prefix an abnormal CLI command termination with 'fatal:'
Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit.pgm.test')
3 files changed, 6 insertions, 4 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 78e752d44e..982aa95216 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 900164e98f..5193aaa42d 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 33cfb9aff0..d7b91cc51a 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")); } |