]> source.dussan.org Git - jgit.git/commit
Release ArchiveCommand's ObjectReader in call() 48/13148/1
authorJonathan Nieder <jrn@google.com>
Sat, 25 May 2013 01:24:53 +0000 (18:24 -0700)
committerJonathan Nieder <jrn@google.com>
Sat, 25 May 2013 01:28:37 +0000 (18:28 -0700)
commitf99fa9d23e93fdd34124e2100d629680894477d7
treebaf39310ce76f7ce50939fbedc1302a63de4517e
parent56276d053f44209f25951d3acfba226c563a81f0
Release ArchiveCommand's ObjectReader in call()

Make call() release all private resources so instead of using a
pattern like

ArchiveCommand cmd = git.archive();
try {
cmd.setTree(tree)
. ...
.call();
} finally {
cmd.release();
}

callers can just use git.archive().setTree(tree)....call() directly.

This involves pushing more work out of parameter setters and into
call() so the ObjectReader is not allocated and potentially leaked
before then.

Change-Id: I699f703c6302696e1cc276d7ab8ee597d82f2c5d
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Archive.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java