author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Wed, 15 Dec 2010 15:02:45 +0000 (22:02 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 3 Feb 2011 22:08:30 +0000 (14:08 -0800) | ||
commit | 86e4ca69e358836599d4eb0c0e217caa9c9e455b | |
tree | 1b9f49279e2f071bb12b1777481826de1d139908 | tree | snapshot |
parent | bc96cc87dbb229cbdabfd93391e24ef168713a74 | commit | diff |
tree_entry_interesting(): fix depth limit with overlapping pathspecs
Suppose we have two pathspecs 'a' and 'a/b' (both are dirs) and depth
limit 1. In current code, pathspecs are checked in input order. When
'a/b' is checked against pathspec 'a', it fails depth limit and
therefore is excluded, although it should match 'a/b' pathspec.
This patch reorders all pathspecs alphabetically, then teaches
tree_entry_interesting() to check against the deepest pathspec first,
so depth limit of a shallower pathspec won't affect a deeper one.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Suppose we have two pathspecs 'a' and 'a/b' (both are dirs) and depth
limit 1. In current code, pathspecs are checked in input order. When
'a/b' is checked against pathspec 'a', it fails depth limit and
therefore is excluded, although it should match 'a/b' pathspec.
This patch reorders all pathspecs alphabetically, then teaches
tree_entry_interesting() to check against the deepest pathspec first,
so depth limit of a shallower pathspec won't affect a deeper one.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c | diff | blob | history | |
tree-walk.c | diff | blob | history |