summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2021-11-23 18:05:37 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2021-11-23 18:05:37 -0500
commit32b1a1b3a3a686fbda71fad67581f5d5808bc076 (patch)
treea6cda1430dcf39b11ab0f0dbaf477045aaea656a
parent51545854392a08077631813dd8acdde3b642762c (diff)
parentcde3ed9ecf5397c7fe6f338ef782efe5262e481f (diff)
downloadjgit-32b1a1b3a3a686fbda71fad67581f5d5808bc076.tar.gz
jgit-32b1a1b3a3a686fbda71fad67581f5d5808bc076.zip
Merge "RepoCommand: Do not wrap GitApiExceptions in GitApiExceptions"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
index 095927f3cd..e0a822479f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
@@ -578,10 +578,10 @@ public class RepoCommand extends GitCommand<RevCommit> {
DirCache index = DirCache.newInCore();
ObjectInserter inserter = repo.newObjectInserter();
+
try (RevWalk rw = new RevWalk(repo)) {
prepareIndex(renamedProjects, index, inserter);
ObjectId treeId = index.writeTree(inserter);
-
long prevDelay = 0;
for (int i = 0; i < LOCK_FAILURE_MAX_RETRIES - 1; i++) {
try {
@@ -597,7 +597,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
}
// In the last try, just propagate the exceptions
return commitTreeOnCurrentTip(inserter, rw, treeId);
- } catch (GitAPIException | IOException | InterruptedException e) {
+ } catch (IOException | InterruptedException e) {
throw new ManifestErrorException(e);
}
}
@@ -609,12 +609,11 @@ public class RepoCommand extends GitCommand<RevCommit> {
}
return git.commit().setMessage(RepoText.get().repoCommitMessage)
.call();
- } catch (GitAPIException | IOException e) {
+ } catch (IOException e) {
throw new ManifestErrorException(e);
}
}
-
private void prepareIndex(List<RepoProject> projects, DirCache index,
ObjectInserter inserter) throws IOException, GitAPIException {
Config cfg = new Config();