summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/utils/JGitUtils.java
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2015-06-12 17:59:37 +0100
committerLuca Milanesio <luca.milanesio@gmail.com>2015-06-12 17:59:47 +0100
commita1cee65c7242f69f7e35978d98cea391095d7225 (patch)
treefdb672d7e77c09c1299003c0543a84ce63f610d1 /src/main/java/com/gitblit/utils/JGitUtils.java
parentf3b7e29b210bba61c64ba9aee07cf2eef20ea5f4 (diff)
downloadgitblit-a1cee65c7242f69f7e35978d98cea391095d7225.tar.gz
gitblit-a1cee65c7242f69f7e35978d98cea391095d7225.zip
Bump to JGit 4.0.0
JGit 4.0.0 fixes a memory leak but introduces a non-compatible change for closing the RevWalk: before it was release() but now is close()
Diffstat (limited to 'src/main/java/com/gitblit/utils/JGitUtils.java')
-rw-r--r--src/main/java/com/gitblit/utils/JGitUtils.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java
index 69084ca1..356a796c 100644
--- a/src/main/java/com/gitblit/utils/JGitUtils.java
+++ b/src/main/java/com/gitblit/utils/JGitUtils.java
@@ -774,7 +774,7 @@ public class JGitUtils {
}
} finally {
rw.dispose();
- tw.release();
+ tw.close();
}
return content;
}
@@ -885,7 +885,7 @@ public class JGitUtils {
} catch (IOException e) {
error(e, repository, "{0} failed to get files for commit {1}", commit.getName());
} finally {
- tw.release();
+ tw.close();
}
Collections.sort(list);
return list;
@@ -942,7 +942,7 @@ public class JGitUtils {
} catch (IOException e) {
error(e, repository, "{0} failed to get files for commit {1}", commit.getName());
} finally {
- tw.release();
+ tw.close();
}
Collections.sort(list);
return list;
@@ -994,7 +994,7 @@ public class JGitUtils {
.getRawMode(0), tw.getObjectId(0).getName(), commit.getId().getName(),
ChangeType.ADD));
}
- tw.release();
+ tw.close();
} else {
RevCommit parent = rw.parseCommit(commit.getParent(0).getId());
DiffStatFormatter df = new DiffStatFormatter(commit.getName());
@@ -1049,7 +1049,7 @@ public class JGitUtils {
RevCommit start = rw.parseCommit(startRange);
RevCommit end = rw.parseCommit(endRange);
list.addAll(getFilesInRange(repository, start, end));
- rw.release();
+ rw.close();
} catch (Throwable t) {
error(t, repository, "{0} failed to determine files in range {1}..{2}!", startCommit, endCommit);
}
@@ -1147,7 +1147,7 @@ public class JGitUtils {
} catch (IOException e) {
error(e, repository, "{0} failed to get documents for commit {1}", commit.getName());
} finally {
- tw.release();
+ tw.close();
}
Collections.sort(list);
return list;
@@ -2044,7 +2044,7 @@ public class JGitUtils {
error(t, repository, "{0} can't find {1} in commit {2}", path, commit.name());
} finally {
rw.dispose();
- tw.release();
+ tw.close();
}
return commitId;
}
@@ -2218,10 +2218,10 @@ public class JGitUtils {
success = false;
}
} finally {
- revWalk.release();
+ revWalk.close();
}
} finally {
- odi.release();
+ odi.close();
}
} catch (Throwable t) {
error(t, repository, "Failed to create orphan branch {1} in repository {0}", branchName);
@@ -2412,7 +2412,7 @@ public class JGitUtils {
LOGGER.error("Failed to determine canMerge", e);
} finally {
if (revWalk != null) {
- revWalk.release();
+ revWalk.close();
}
}
return MergeStatus.NOT_MERGEABLE;
@@ -2498,14 +2498,14 @@ public class JGitUtils {
// return the merge commit id
return new MergeResult(MergeStatus.MERGED, mergeCommitId.getName());
} finally {
- odi.release();
+ odi.close();
}
}
} catch (IOException e) {
LOGGER.error("Failed to merge", e);
} finally {
if (revWalk != null) {
- revWalk.release();
+ revWalk.close();
}
}
return new MergeResult(MergeStatus.FAILED, null);