Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java')
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java35
1 files changed, 5 insertions, 30 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
index 8b0435f9aa..e662f2c96a 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/CommitOperation.java
@@ -31,13 +31,8 @@ import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.jgit.api.AddCommand;
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
+import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException;
-import org.eclipse.jgit.api.errors.NoFilepatternException;
-import org.eclipse.jgit.api.errors.NoHeadException;
-import org.eclipse.jgit.api.errors.NoMessageException;
-import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
-import org.eclipse.jgit.errors.UnmergedPathException;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -217,13 +212,12 @@ public class CommitOperation implements IEGitOperation {
addCommand.addFilepattern(path);
fileAdded = true;
}
- if (fileAdded) {
+ if (fileAdded)
try {
addCommand.call();
- } catch (NoFilepatternException e) {
+ } catch (Exception e) {
throw new CoreException(Activator.error(e.getMessage(), e));
}
- }
}
public ISchedulingRule getSchedulingRule() {
@@ -253,20 +247,9 @@ public class CommitOperation implements IEGitOperation {
for(String path:commitFileList)
commitCommand.setOnly(path);
commit = commitCommand.call();
- } catch (NoHeadException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (NoMessageException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (UnmergedPathException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (ConcurrentRefUpdateException e) {
- throw new TeamException(
- CoreText.MergeOperation_InternalError, e);
- } catch (JGitInternalException e) {
+ } catch (Exception e) {
throw new TeamException(
CoreText.MergeOperation_InternalError, e);
- } catch (WrongRepositoryStateException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
}
}
@@ -316,17 +299,9 @@ public class CommitOperation implements IEGitOperation {
new PersonIdent(committerIdent, commitDate,
timeZone)).setMessage(message)
.setInsertChangeId(createChangeId).call();
- } catch (NoHeadException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (NoMessageException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (UnmergedPathException e) {
- throw new TeamException(e.getLocalizedMessage(), e);
- } catch (ConcurrentRefUpdateException e) {
- throw new TeamException(CoreText.MergeOperation_InternalError, e);
} catch (JGitInternalException e) {
throw new TeamException(CoreText.MergeOperation_InternalError, e);
- } catch (WrongRepositoryStateException e) {
+ } catch (GitAPIException e) {
throw new TeamException(e.getLocalizedMessage(), e);
}
}

Back to the top