From f332726eaad74ac2aac0c3fb2dcb662acdbc3a31 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 16 Aug 2005 20:44:32 -0700 Subject: [PATCH] Improve handling of "." and ".." in git-diff-* This fixes up usage of ".." (without an ending slash) and "." (with or without the ending slash) in the git diff family. It also fixes pathspec matching for the case of an empty pathspec, since a "." in the top-level directory (or enough ".." under subdirectories) will result in an empty pathspec. We used to not match it against anything, but it should in fact match everything. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- read-cache.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'read-cache.c') diff --git a/read-cache.c b/read-cache.c index 5820f18d9..ced597318 100644 --- a/read-cache.c +++ b/read-cache.c @@ -191,6 +191,8 @@ int ce_path_match(const struct cache_entry *ce, const char **pathspec) return 1; if (name[matchlen] == '/' || !name[matchlen]) return 1; + if (!matchlen) + return 1; } return 0; } -- cgit v1.2.1