]> source.dussan.org Git - jgit.git/commitdiff
Simplify UploadPack use of options during writing 89/1189/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 17:52:36 +0000 (10:52 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 19:13:48 +0000 (12:13 -0700)
We only use these variables once, so just put them at the proper
use site and avoid assigning the local variable.  The code is a
bit shorter and the intent is a little bit more clear.

Change-Id: I70d120fb149b612ac93055ea39bc053b8d90a5db
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

index 02ce251bea081186060db4677ead73f727eab0f9..e7338598c54af4d812795b4c23bd59ba6dc16634 100644 (file)
@@ -548,8 +548,6 @@ public class UploadPack {
        }
 
        private void sendPack() throws IOException {
-               final boolean thin = options.contains(OPTION_THIN_PACK);
-               final boolean progress = !options.contains(OPTION_NO_PROGRESS);
                final boolean sideband = options.contains(OPTION_SIDE_BAND)
                                || options.contains(OPTION_SIDE_BAND_64K);
 
@@ -563,7 +561,7 @@ public class UploadPack {
 
                        packOut = new SideBandOutputStream(SideBandOutputStream.CH_DATA,
                                        bufsz, rawOut);
-                       if (progress)
+                       if (!options.contains(OPTION_NO_PROGRESS))
                                pm = new SideBandProgressMonitor(new SideBandOutputStream(
                                                SideBandOutputStream.CH_PROGRESS, bufsz, rawOut));
                }
@@ -571,7 +569,7 @@ public class UploadPack {
                final PackWriter pw = new PackWriter(db, walk.getObjectReader());
                try {
                        pw.setDeltaBaseAsOffset(options.contains(OPTION_OFS_DELTA));
-                       pw.setThin(thin);
+                       pw.setThin(options.contains(OPTION_THIN_PACK));
                        pw.preparePack(pm, wantAll, commonBase);
                        if (options.contains(OPTION_INCLUDE_TAG)) {
                                for (final Ref r : refs.values()) {