summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-09-04 12:07:37 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2016-09-05 17:41:36 +0200
commitabeaafc9c7c9dcea72ea5c7e0e93417bb2111cc6 (patch)
tree72bdfb11d8686fd154e2b5fadd7dd80131c63a43 /org.eclipse.jgit.test
parentc711361612e4860a2aa8388bc971dba55f3d39b5 (diff)
downloadjgit-abeaafc9c7c9dcea72ea5c7e0e93417bb2111cc6.tar.gz
jgit-abeaafc9c7c9dcea72ea5c7e0e93417bb2111cc6.zip
Don't log error if system git config does not exist
- enhance FS.readPipe to throw an exception if the external command fails to enable the caller to handle the command failure - reduce log level to warning if system git config does not exist - improve log message Bug: 476639 Change-Id: I94ae3caec22150dde81f1ea8e1e665df55290d42 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java
index 3d09b92ef4..4061b5600b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java
@@ -50,11 +50,13 @@ import static org.junit.Assume.assumeTrue;
import java.io.File;
import java.io.IOException;
+import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.attribute.PosixFileAttributeView;
import java.nio.file.attribute.PosixFilePermission;
import java.util.Set;
+import org.eclipse.jgit.errors.CommandFailedException;
import org.eclipse.jgit.junit.RepositoryTestCase;
import org.junit.After;
import org.junit.Assume;
@@ -164,4 +166,15 @@ public class FSTest {
.readAttributes().permissions();
}
+ @Test(expected = CommandFailedException.class)
+ public void testReadPipePosixCommandFailure()
+ throws CommandFailedException {
+ FS fs = FS.DETECTED.newInstance();
+ assumeTrue(fs instanceof FS_POSIX);
+
+ String r = FS.readPipe(fs.userHome(),
+ new String[] { "bash", "--login", "-c", "foobar" },
+ Charset.defaultCharset().name());
+ System.out.println(r);
+ }
}