]> source.dussan.org Git - jgit.git/commitdiff
CommitCommand: Remove redundant null check 12/64312/1
authorDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 05:59:55 +0000 (14:59 +0900)
committerDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 06:04:34 +0000 (15:04 +0900)
Repository.getWorkTree is annotated as @NonNull, so the check
for it returning null is redundant.

Change-Id: I597b0f774ff857b8900519f14a1a17a904cf7c6f
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java

index 9466dab74eae7fd9b5171776d62d04facd923b3b..6828ed338fb7b90905427998f5ece189319d8c1c 100644 (file)
@@ -179,7 +179,7 @@ public class CommitCommand extends GitCommand<RevCommit> {
 
                        processOptions(state, rw);
 
-                       if (all && !repo.isBare() && repo.getWorkTree() != null) {
+                       if (all && !repo.isBare()) {
                                try (Git git = new Git(repo)) {
                                        git.add()
                                                        .addFilepattern(".") //$NON-NLS-1$