diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index feb5bbc836..34bf0eb16b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -2020,18 +2020,14 @@ public class PackWriter { } private boolean reuseDeltaFor(ObjectToPack otp) { - switch (otp.getType()) { - case Constants.OBJ_COMMIT: - return reuseDeltaCommits; - case Constants.OBJ_TREE: - return true; - case Constants.OBJ_BLOB: + int type = otp.getType(); + if ((type & 2) != 0) // OBJ_TREE(2) or OBJ_BLOB(3) return true; - case Constants.OBJ_TAG: + if (type == OBJ_COMMIT) + return reuseDeltaCommits; + if (type == OBJ_TAG) return false; - default: - return true; - } + return true; } /** Summary of how PackWriter created the pack. */ |