[PATCH 1/5] pathspec: mark wildcard pathspecs from the beginning

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

 



Signed-off-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>
---
 match_pathspec() should be converted to use this as well. Not now
 though.

 cache.h |    2 ++
 dir.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/cache.h b/cache.h
index 045c9fc..7a3e0a0 100644
--- a/cache.h
+++ b/cache.h
@@ -495,8 +495,10 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
 struct pathspec {
 	const char **raw;
 	int nr;
+	int has_wildcard:1;
 	struct pathspec_item {
 		int len;
+		int has_wildcard:1;
 	} *items;
 };
 
diff --git a/dir.c b/dir.c
index 80b2df2..a44c7b3 100644
--- a/dir.c
+++ b/dir.c
@@ -1088,7 +1088,12 @@ int init_pathspec(struct pathspec *pathspec, const char **paths)
 
 	pathspec->items = xmalloc(sizeof(struct pathspec_item)*pathspec->nr);
 	for (i = 0; i < pathspec->nr; i++) {
-		pathspec->items[i].len = strlen(paths[i]);
+		struct pathspec_item *item = pathspec->items+i;
+
+		item->len = strlen(paths[i]);
+		item->has_wildcard = !no_wildcard(paths[i]);
+		if (item->has_wildcard)
+			pathspec->has_wildcard = 1;
 	}
 	return 0;
 }
-- 
1.7.1.rc1.70.g788ca

--
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]