]> source.dussan.org Git - jgit.git/commitdiff
pgm: Fix missing braces in Fetch.run() 27/135427/1
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 20 Jan 2019 20:21:13 +0000 (21:21 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 20 Jan 2019 21:18:41 +0000 (22:18 +0100)
Change-Id: I4655417fd879733a357bf712a486ce0883021198
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java

index f29740d8a040bd587fb5c445b177173e6042b88e..da3c498796f3835f422fdf1b622a85ff2b317806 100644 (file)
@@ -140,24 +140,30 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback {
        protected void run() {
                try (Git git = new Git(db)) {
                        FetchCommand fetch = git.fetch();
-                       if (fsck != null)
+                       if (fsck != null) {
                                fetch.setCheckFetchedObjects(fsck.booleanValue());
-                       if (prune != null)
+                       }
+                       if (prune != null) {
                                fetch.setRemoveDeletedRefs(prune.booleanValue());
-                       if (toget != null)
+                       }
+                       if (toget != null) {
                                fetch.setRefSpecs(toget);
+                       }
                        if (tags != null) {
                                fetch.setTagOpt(tags.booleanValue() ? TagOpt.FETCH_TAGS
                                                : TagOpt.NO_TAGS);
                        }
-                       if (0 <= timeout)
+                       if (0 <= timeout) {
                                fetch.setTimeout(timeout);
+                       }
                        fetch.setDryRun(dryRun);
                        fetch.setRemote(remote);
-                       if (thin != null)
+                       if (thin != null) {
                                fetch.setThin(thin.booleanValue());
-                       if (quiet == null || !quiet.booleanValue())
+                       }
+                       if (quiet == null || !quiet.booleanValue()) {
                                fetch.setProgressMonitor(new TextProgressMonitor(errw));
+                       }
                        fetch.setRecurseSubmodules(recurseSubmodules).setCallback(this);
                        if (force != null) {
                                fetch.setForceUpdate(force.booleanValue());
@@ -165,9 +171,9 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback {
 
                        FetchResult result = fetch.call();
                        if (result.getTrackingRefUpdates().isEmpty()
-                                       && result.submoduleResults().isEmpty())
+                                       && result.submoduleResults().isEmpty()) {
                                return;
-
+                       }
                        showFetchResult(result);
                } catch (GitAPIException | IOException e) {
                        throw die(e.getMessage(), e);