diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-01-27 14:44:14 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-01-28 17:46:28 +0100 |
commit | acc94c475a4d2635584798d43a3e47a81b2b2751 (patch) | |
tree | 7613d49e19312385a2c0ad4ad8c9bc5d169b15f3 /org.eclipse.jgit.test | |
parent | 883856110c294cd3e33d5558d4dc476d563edfe8 (diff) | |
download | jgit-acc94c475a4d2635584798d43a3e47a81b2b2751.tar.gz jgit-acc94c475a4d2635584798d43a3e47a81b2b2751.zip |
RepoCommand#readFile: Don't call Git#getRepository() in try-with-resource
Using try-with-resource means that close() will automatically be
called on the Repository object. However, according to the javadoc
of Git#close():
If the repository was opened by a static factory method in this class,
then this method calls Repository#close() on the underlying repository
instance.
This means that Repository#close() is called twice, by Git.close()
and in the outer try-with-resource, leading to a corrupt use count.
Change-Id: I37ba517eb2cc67d1cd36813598772c70208d0bc9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
0 files changed, 0 insertions, 0 deletions