summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorKetan Padegaonkar2011-05-02 12:48:27 (EDT)
committer Chris Aniszczyk2011-05-03 13:09:04 (EDT)
commit04df086d3e2564b06d2a462449942fcf6e71421b (patch)
tree2c40a101ec54f1146637a1b060fa32ec4cdfdd03
parent7a9ebbfa9f39e67f00ab599f3d65098c55987f03 (diff)
downloadjgit-04df086d3e2564b06d2a462449942fcf6e71421b.zip
jgit-04df086d3e2564b06d2a462449942fcf6e71421b.tar.gz
jgit-04df086d3e2564b06d2a462449942fcf6e71421b.tar.bz2
Add better exception handling for the git-init ant taskrefs/changes/13/3313/2
Change-Id: Ia935720fc9c09b427abb84be038c4dc74610850c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
index cab45e0..7b1610e 100644
--- a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
+++ b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
@@ -48,6 +48,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
+import org.eclipse.jgit.api.errors.JGitInternalException;
/**
* Create an empty git repository.
@@ -86,8 +87,12 @@ public class GitInitTask extends Task {
} else {
log("Initializing repository at " + destination);
}
- InitCommand init = Git.init();
- init.setBare(bare).setDirectory(destination);
- init.call();
+ try {
+ InitCommand init = Git.init();
+ init.setBare(bare).setDirectory(destination);
+ init.call();
+ } catch (JGitInternalException e) {
+ throw new BuildException("Could not initialize repository", e);
+ }
}
}