diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2010-12-10 21:58:05 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2011-01-28 01:11:12 +0100 |
commit | 38eec8f4a26935ba9e75bfbdde8a5682e05f338d (patch) | |
tree | e609e5e005fed86ef245b1646010312eaa0a3a61 /org.eclipse.jgit.pgm | |
parent | f5fe2dca3cb9f57891e1a4b18832fcc158d0c490 (diff) | |
download | jgit-38eec8f4a26935ba9e75bfbdde8a5682e05f338d.tar.gz jgit-38eec8f4a26935ba9e75bfbdde8a5682e05f338d.zip |
[findbugs] Do not ignore exceptional return value of mkdir
java.io.File.mkdir() and mkdirs() report failure as an exceptional
return value false. Fix the code which silently ignored this
exceptional return value.
Change-Id: I41244f4b9d66176e68e2c07e2329cf08492f8619
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/eclipse/Iplog.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Iplog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Iplog.java index 84859a805c..86b93a0f84 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Iplog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/eclipse/Iplog.java @@ -59,6 +59,7 @@ import org.eclipse.jgit.revwalk.RevObject; import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.storage.file.LockFile; +import org.eclipse.jgit.util.FileUtils; import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; @@ -96,8 +97,7 @@ class Iplog extends TextBuiltin { log.scan(db, rw.parseCommit(start), version); if (output != null) { - if (!output.getParentFile().exists()) - output.getParentFile().mkdirs(); + FileUtils.mkdirs(output.getParentFile(), true); LockFile lf = new LockFile(output, db.getFS()); if (!lf.lock()) throw die(MessageFormat.format(CLIText.get().cannotLock, output)); |