[PATCH 2/5] match_pathspec_depth: support negative pathspec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The return value of this function is bugging me, as well as seen[]
array. Not really sure how to do with them when a negative pathspec is
matched.

Signed-off-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>
---
 dir.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dir.c b/dir.c
index 168dad6..75c4a8f 100644
--- a/dir.c
+++ b/dir.c
@@ -279,6 +279,11 @@ int match_pathspec_depth(const struct pathspec *ps,
 				how = 0;
 		}
 		if (how) {
+			if (ps->items[i].to_exclude) {
+				if (seen && seen[i] < how)
+					seen[i] = how;
+				return 0;
+			}
 			if (retval < how)
 				retval = how;
 			if (seen && seen[i] < how)
-- 
1.7.3.1.256.g2539c.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]