commit | 7b41f3a413b46140b050ae5324cbbcdd467d2b3a | [log] [tgz] |
---|---|---|
author | David Pursehouse <dpursehouse@collab.net> | Wed Jun 01 21:17:06 2016 +0900 |
committer | David Pursehouse <dpursehouse@collab.net> | Wed Jun 01 21:18:57 2016 +0900 |
tree | 7249677495d27a5c9c88f3fd022916016cf50842 | |
parent | fb05fb988e17b1a2eb7ef476b8613419312afabd [diff] |
Fix 'Statement unnecessarily nested within else clause' warnings Change-Id: I53c039d2d8904f6465a5560d9cbb2716df5c48c7
diff --git a/src/main/java/com/googlesource/gerrit/plugins/download/command/GitDownloadCommand.java b/src/main/java/com/googlesource/gerrit/plugins/download/command/GitDownloadCommand.java index 8700262..03b817d 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/download/command/GitDownloadCommand.java +++ b/src/main/java/com/googlesource/gerrit/plugins/download/command/GitDownloadCommand.java
@@ -109,14 +109,12 @@ ObjectId id = repo.resolve(ref); if (id != null) { return id.name(); - } else { - log.error(String.format("Cannot resolve ref %s in project %s.", ref, - project)); - return null; } - } else { - return ref; + log.error(String.format("Cannot resolve ref %s in project %s.", ref, + project)); + return null; } + return ref; } catch (RepositoryNotFoundException e) { log.error(String.format("Missing project: %s", project), e); return null;