Skip to content

Commit c665ec9

Browse files
committed
Local variables should not be declared and then immediately returned
Signed-off-by:Matteo Baccan <matteo.baccan@gmail.com>
1 parent 2cc698f commit c665ec9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

core/src/main/java/pl/project13/core/jgit/JGitCommon.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,11 @@ public static boolean isRepositoryInDirtyState(Repository repo) throws GitAPIExc
341341
// repo is dirty. JGit does this, so we cannot use the isClean method
342342
// to get the same behaviour. Instead check dirty state without
343343
// status.getUntracked().isEmpty()
344-
boolean isDirty = !(status.getAdded().isEmpty()
344+
return !(status.getAdded().isEmpty()
345345
&& status.getChanged().isEmpty()
346346
&& status.getRemoved().isEmpty()
347347
&& status.getMissing().isEmpty()
348348
&& status.getModified().isEmpty()
349349
&& status.getConflicting().isEmpty());
350-
351-
return isDirty;
352350
}
353351
}

0 commit comments

Comments
 (0)