From 074f9194dc5c4ad4987f7ec6f956c7da7d80702c Mon Sep 17 00:00:00 2001 From: Tomasz Zarna Date: Sun, 11 Nov 2012 23:43:38 +0100 Subject: Prefix an abnormal CLI command termination with 'fatal:' Change-Id: I3d257666c6fbed7b238c575808f73ec518e811b9 Signed-off-by: Chris Aniszczyk --- org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java | 4 +++- org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BranchTest.java | 2 +- org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit.pgm.test') 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")); } -- cgit v1.2.3