diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-02-10 00:50:41 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-02-10 00:51:01 +0100 |
commit | 28e2fed761f0ddf01029c999b299ed0bccdf630e (patch) | |
tree | f7878683e3aef308a939015091c978bff2488431 /org.eclipse.jgit.pgm | |
parent | c901cd89d35fe2cc014c7e0f5849e32a14fe679a (diff) | |
parent | 26012958a35d85639fe44fdbd4690cb58ec3b836 (diff) | |
download | jgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.tar.gz jgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.zip |
Merge branch 'stable-4.2'
* stable-4.2:
RepoProject: Fix warnings about variable hiding
RepoTest: Open Git in try-with-resources
RepositoryResolveTest: Open Git in try-with-resource
RepositoryTestCase: Open autocloseable types in try-with-resource
ResetCommandTest: Use Git member in testHardResetAfterSquashMerge
ResolveMergerTest: Open Git in try-with-resource
RevCommitListTest: Open Git and RevWalk in try-with-resource
RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource
RevObjectTest: Open RevWalk in try-with-resource
RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource
RevertCommandTest: Open Git in try-with-resource
SquashMessageFormatterTest: Open git in try-with-resource
StatusCommandTest: Open Git in try-with-resource
SubmoduleAddTest: Open Git in try-with-resource
SymlinksTest: Open git and TreeWalk in try-with-resource
T0003_BasicTest: Open autocloseable types in try-with-resource
TextHashFunctions: Fix warnings about variable hiding
TreeFilterTest: Open TreeWalk in try-with-resource
TreeWalkJava7Test: Open TreeWalk in try-with-resource
Fix diff for added and removed submodule
Change-Id: If3ecc63f6dfac55474d3c1dd2f4105371f3d24fb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java index 062f4e7a1f..28d92aeca1 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java @@ -286,25 +286,25 @@ class TextHashFunctions extends TextBuiltin { else rb.findGitDir(dir); - Repository db = rb.build(); + Repository repo = rb.build(); try { - run(db); + run(repo); } finally { - db.close(); + repo.close(); } } } - private void run(Repository db) throws Exception { + private void run(Repository repo) throws Exception { List<Function> all = init(); long fileCnt = 0; long lineCnt = 0; - try (ObjectReader or = db.newObjectReader(); + try (ObjectReader or = repo.newObjectReader(); RevWalk rw = new RevWalk(or); TreeWalk tw = new TreeWalk(or)) { final MutableObjectId id = new MutableObjectId(); - tw.reset(rw.parseTree(db.resolve(Constants.HEAD))); + tw.reset(rw.parseTree(repo.resolve(Constants.HEAD))); tw.setRecursive(true); while (tw.next()) { @@ -341,7 +341,7 @@ class TextHashFunctions extends TextBuiltin { } } - File directory = db.getDirectory(); + File directory = repo.getDirectory(); if (directory != null) { String name = directory.getName(); File parent = directory.getParentFile(); |