[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>
This commit is contained in:

committed by
Junio C Hamano

parent
a579defe5a
commit
f332726eaa
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user