aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorpszlazak <piotr.szlazak@gmail.com>2024-11-17 23:11:02 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2024-11-21 20:44:53 +0100
commit5b1513a28d337e7e3453e557ee9dde292678eb81 (patch)
tree451e064a7f8442c9643c4ac9048472a1341bec00 /org.eclipse.jgit.test
parentc824610abba794a1f8f13d6ff2ec1c09590ce697 (diff)
downloadjgit-5b1513a28d337e7e3453e557ee9dde292678eb81.tar.gz
jgit-5b1513a28d337e7e3453e557ee9dde292678eb81.zip
Align request policies with CGit
CGit defines the SHA request policies using a bitmask that represents which policy is implied by another policy. For example, in CGit the ALLOW_TIP_SHA1 is 0x01 and ALLOW_REACHABLE_SHA1 is 0x02, which are associated to two different bit in a 3-bit value. The ALLOW_ANY_SHA1 value is 0x07 which denotes a different policy that implies the previous two ones, because is represented with a 3-bit bitmask having all ones. Associate the JGit RequestPolicy enum to the same CGit bitmask values and use the same logic for the purpose of advertising the server capabilities. The JGit code becomes easier to read and associate with its counterpart in CGit, especially during the capabilities advertising phase. Also add a new utility method RequestPolicy.implies() which is more readable than a direct bitmask and operator. Bug: jgit-68 Change-Id: I932150dca1211ba9c8c34a523f13e84d7390063b (cherry picked from commit 1519c147948eb1108bdf45f2aeed84746dacff9c)
Diffstat (limited to 'org.eclipse.jgit.test')
0 files changed, 0 insertions, 0 deletions