aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-30 09:48:36 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-30 09:48:36 -0700
commitcb9d8285bacf315e323d41f7bdc42acc8124fe98 (patch)
tree28d4797185f8934638cdb32880a3d730531c498f /org.eclipse.jgit.test
parent515deaf7e503738b4c53c3c2dfd6d7acab3bef18 (diff)
downloadjgit-cb9d8285bacf315e323d41f7bdc42acc8124fe98.tar.gz
jgit-cb9d8285bacf315e323d41f7bdc42acc8124fe98.zip
Create NoWorkTreeException for bare repositories
Using a custom exception type makes it easire for an application developer to understand why an exception was thrown out of a method we declare. To remain compatiable with existing callers, we still extend off IllegalStateException. Change-Id: Ideeef2399b11ca460a2dbb3cd80eb76aa0a025ba Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RepositorySetupWorkDirTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RepositorySetupWorkDirTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RepositorySetupWorkDirTest.java
index caaeda2b03..4f6d5b3bd6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RepositorySetupWorkDirTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RepositorySetupWorkDirTest.java
@@ -48,6 +48,7 @@ import java.io.File;
import java.io.IOException;
import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
@@ -136,8 +137,8 @@ public class RepositorySetupWorkDirTest extends LocalDiskRepositoryTestCase {
File gitDir = getFile("workdir");
try {
new FileRepository(gitDir).getWorkTree();
- fail("Expected IllegalStateException missing");
- } catch (IllegalStateException e) {
+ fail("Expected NoWorkTreeException missing");
+ } catch (NoWorkTreeException e) {
// expected
}
}
@@ -146,8 +147,8 @@ public class RepositorySetupWorkDirTest extends LocalDiskRepositoryTestCase {
File gitDir = getFile("workdir");
try {
new FileRepository(gitDir).getIndex();
- fail("Expected IllegalStateException missing");
- } catch (IllegalStateException e) {
+ fail("Expected NoWorkTreeException missing");
+ } catch (NoWorkTreeException e) {
// expected
}
}
@@ -156,8 +157,8 @@ public class RepositorySetupWorkDirTest extends LocalDiskRepositoryTestCase {
File gitDir = getFile("workdir");
try {
new FileRepository(gitDir).getIndexFile();
- fail("Expected Exception missing");
- } catch (IllegalStateException e) {
+ fail("Expected NoWorkTreeException missing");
+ } catch (NoWorkTreeException e) {
// expected
}
}