summaryrefslogtreecommitdiffstats
path: root/.mailmap
diff options
context:
space:
mode:
authorMagnus Vigerlöf <magnus.vigerlof@gmail.com>2017-02-18 19:28:39 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2017-02-28 23:56:33 +0100
commit2a5d20c138b0e16160329e9030d56158da9ceffb (patch)
treea4395d4abd522434b8b0a8cc6e0126c1463f3220 /.mailmap
parentb24c8fca49bfa0dcaef094a7630b7b334f966fbc (diff)
downloadjgit-2a5d20c138b0e16160329e9030d56158da9ceffb.tar.gz
jgit-2a5d20c138b0e16160329e9030d56158da9ceffb.zip
Correct the boolean logic for filtering paths
The TreeWalk filtering classes need to support the three different meanings of the return value the path comparison generates. A new path comparison method (isPathMatch) is created with three distinct return values (isPathPrefix use value '0' to encode two of these) which will makes it possible for the logical operators (especially NOT) to aggregate a correct verdict. A filter like: AND(Path("path"), NOT(Path("path/to/other"))) Should filter out 'path/to/other/file', but not 'path/to/my/file'. The path-limiting feature when testing path/to/my/file, would result to run test for the following paths: path path/to path/to/my path/to/my/file isPathPrefix('path/to/other') will return '0' for the first two and since there is no way for NOT to distinguish between an exact match and a match indicating that the tested path is a 'parent', it will incorrectly return false and thus remove everything below 'path' immediately. isPathMatch has a distinguished value for 'parent' matches that will be preserved through the logic operators and should not cause an over-eager removal of paths. The functionality of isPathPrefix is required by other parts and is untouched. Unit tests are included to ensure that the logical functionality is correct and can be preserved. Change-Id: Ice2ca9406f09f1b179569e99b86a0e5d77baa20d Signed-off-by: Magnus Vigerlöf <magnus.vigerlof@gmail.com>
Diffstat (limited to '.mailmap')
0 files changed, 0 insertions, 0 deletions