aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2015-05-09 10:47:13 -0700
committerShawn Pearce <spearce@spearce.org>2015-05-10 10:45:34 -0700
commit53e39094bf012a4f5b3fe5557219707cb7b0f010 (patch)
treea1f7352fad14868f6b37bf29a2ccc3a2535610d8 /org.eclipse.jgit.test/tst
parent3d06349ff21e157fc837ef09e48a5e400afb4e6a (diff)
downloadjgit-53e39094bf012a4f5b3fe5557219707cb7b0f010.tar.gz
jgit-53e39094bf012a4f5b3fe5557219707cb7b0f010.zip
ObjectWalk: make setRetainBody(false) the default
Despite being the primary author of RevWalk and ObjectWalk I still fail to remember to setRetainBody(false) in application code using an ObjectWalk to examine the graph. Document the default for RevWalk is setRetainBody(true), where the application usually wants the commit bodies to display or inspect. Change the default for ObjectWalk to setRetainBody(false), as nearly all callers want only the graph shape and do not need the larger text inside a commit body. This allows some code in JGit to be simplified. Change-Id: I367e42209e805bd5e1f41b4072aeb2fa98ec9d99
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
index 0ad3b77427..fbd5127116 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
@@ -360,10 +360,10 @@ public class FooterLineTest extends RepositoryTestCase {
buf.append("\n");
buf.append(msg);
- final RevWalk walk = new RevWalk(db);
- walk.setRetainBody(true);
- final RevCommit c = new RevCommit(ObjectId.zeroId());
- c.parseCanonical(walk, Constants.encode(buf.toString()));
- return c;
+ try (RevWalk walk = new RevWalk(db)) {
+ RevCommit c = new RevCommit(ObjectId.zeroId());
+ c.parseCanonical(walk, Constants.encode(buf.toString()));
+ return c;
+ }
}
}