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 --- diffcore-pathspec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'diffcore-pathspec.c') diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c index a48acbc96..68fe00913 100644 --- a/diffcore-pathspec.c +++ b/diffcore-pathspec.c @@ -29,6 +29,8 @@ static int matches_pathspec(const char *name, struct path_spec *s, int cnt) name[len] == 0 || name[len] == '/') return 1; + if (!len) + return 1; } return 0; } -- cgit v1.2.1