]> git.ipfire.org Git - thirdparty/git.git/commit - rerere.c
pathspec: pass directory indicator to match_pathspec_item()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 24 Jan 2014 13:40:33 +0000 (20:40 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2014 22:37:19 +0000 (14:37 -0800)
commitae8d0824217bdf97c69ead49568cd03fc140627b
treec188d3275e08dd074476d03a8656981dbd5ef643
parent68690fdd0b78762eb6387d7a437b588d15b6cf47
pathspec: pass directory indicator to match_pathspec_item()

This patch activates the DO_MATCH_DIRECTORY code in m_p_i(), which
makes "git diff HEAD submodule/" and "git diff HEAD submodule" produce
the same output. Previously only the version without trailing slash
returns the difference (if any).

That's the effect of new ce_path_match(). dir_path_match() is not
executed by the new tests. And it should not introduce regressions.

Previously if path "dir/" is passed in with pathspec "dir/", they
obviously match. With new dir_path_match(), the path becomes
_directory_ "dir" vs pathspec "dir/", which is not executed by the old
code path in m_p_i(). The new code path is executed and produces the
same result.

The other case is pathspec "dir" and path "dir/" is now turned to
"dir" (with DO_MATCH_DIRECTORY). Still the same result before or after
the patch.

So why change? Because of the next patch about clean.c.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clean.c
builtin/ls-files.c
dir.c
dir.h
rerere.c
t/t4010-diff-pathspec.sh