Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-08-17 07:44:32 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-17 08:33:25 +0400
commitf332726eaad74ac2aac0c3fb2dcb662acdbc3a31 (patch)
treeb286ced3860a853e4ebcea7f7e2b10b2571215bd /read-cache.c
parenta579defe5a43bdd242d79750039758f319b82a38 (diff)
[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 <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 5820f18d9a..ced597318e 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;
}