Skip to content

Commit f9addab

Browse files
msohngerritforge-ltd
authored andcommitted
Merge "UploadPack: suppress resource warning for DepthWalk.RevWalk"
2 parents c9586d1 + 2f15177 commit f9addab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,8 @@ else if (ref.getName().startsWith(Constants.R_HEADS))
23692369
: req.getDepth() - 1;
23702370
pw.setShallowPack(req.getDepth(), unshallowCommits);
23712371

2372-
// Ownership is transferred below
2372+
// dw borrows the reader from walk which is closed by #close
2373+
@SuppressWarnings("resource")
23732374
DepthWalk.RevWalk dw = new DepthWalk.RevWalk(
23742375
walk.getObjectReader(), walkDepth);
23752376
dw.setDeepenSince(req.getDeepenSince());

0 commit comments

Comments
 (0)