summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-07-28 10:52:36 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-07-28 12:13:48 -0700
commitbb99ec0aa00aab6d9f60e4d35c93d20bd614e4dc (patch)
tree8507b42d13e36892d456e79e2f9022a34ebb8865
parent1a06179ea707ab088b6543df77be5cf0ea44c497 (diff)
downloadjgit-bb99ec0aa00aab6d9f60e4d35c93d20bd614e4dc.tar.gz
jgit-bb99ec0aa00aab6d9f60e4d35c93d20bd614e4dc.zip
Simplify UploadPack use of options during writing
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
index 02ce251bea..e7338598c5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -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()) {