Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 05b8502

Browse files
pcloudsgitster
authored andcommitted
clean: replace match_pathspec() with dir_path_match()
This instance was left out when many match_pathspec() call sites that take input from dir_entry were converted to dir_path_match() because it passed a path with the trailing slash stripped out to match_pathspec() while the others did not. Stripping for all call sites back then would be a regression because match_pathspec() did not know how to match pathspec foo/ against _directory_ foo (the stripped version of path "foo/"). match_pathspec() knows how to do it now. And dir_path_match() strips the trailing slash also. Use the new function, because the stripping code is removed in the next patch. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ae8d082 commit 05b8502

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/clean.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
961961
die_errno("Cannot lstat '%s'", ent->name);
962962

963963
if (pathspec.nr)
964-
matches = match_pathspec(&pathspec, ent->name,
965-
len, 0, NULL, 0);
964+
matches = dir_path_match(ent, &pathspec, 0, NULL);
966965

967966
if (S_ISDIR(st.st_mode)) {
968967
if (remove_directories || (matches == MATCHED_EXACTLY)) {

0 commit comments

Comments
 (0)