From d2fa3987a064574b0ead67acabbdb2bedb3315e0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 30 Oct 2013 08:55:14 -0700 Subject: [PATCH] Use bitcheck to check for presence of OPT_FULL option Previously an equality check was performed so an exception would be thrown if any other options were set. Change-Id: I36b60e2c0a8aef9fcfe663055dba520192996872 --- .../jgit/internal/storage/file/PackBitmapIndexV1.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java index c79a5cb71..6d944fd4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexV1.java @@ -110,15 +110,10 @@ class PackBitmapIndexV1 extends BasePackBitmapIndex { // Read the options (2 bytes) final int opts = NB.decodeUInt16(scratch, 6); - switch (opts) { - case OPT_FULL: - // Bitmaps are self contained within this file. - break; - default: + if ((opts & OPT_FULL) == 0) throw new IOException(MessageFormat.format( JGitText.get().expectedGot, Integer.valueOf(OPT_FULL), Integer.valueOf(opts))); - } // Read the number of entries (1 int32) long numEntries = NB.decodeUInt32(scratch, 8);