pgm: Fix missing braces in Fetch.run()

Change-Id: I4655417fd879733a357bf712a486ce0883021198
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-01-20 21:21:13 +01:00
parent 7a64771b9e
commit 152e4b43a3
1 changed files with 14 additions and 8 deletions

View File

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