diff options
author | Linus Torvalds <torvalds@osdl.org> | 2005-08-17 03:44:32 (GMT) |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-17 04:33:25 (GMT) |
commit | f332726eaad74ac2aac0c3fb2dcb662acdbc3a31 (patch) | |
tree | b286ced3860a853e4ebcea7f7e2b10b2571215bd /diffcore-pathspec.c | |
parent | a579defe5a43bdd242d79750039758f319b82a38 (diff) | |
download | git-f332726eaad74ac2aac0c3fb2dcb662acdbc3a31.zip git-f332726eaad74ac2aac0c3fb2dcb662acdbc3a31.tar.gz git-f332726eaad74ac2aac0c3fb2dcb662acdbc3a31.tar.bz2 |
[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 'diffcore-pathspec.c')
-rw-r--r-- | diffcore-pathspec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c index a48acbc..68fe009 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; } |