Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'dt/clean-pathspec-filter-then-lstat'
author
Junio C Hamano
<gitster@pobox.com>
Mon, 1 Jun 2015 19:45:08 +0000
(12:45 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 1 Jun 2015 19:45:08 +0000
(12:45 -0700)
"git clean pathspec..." tried to lstat(2) and complain even for
paths outside the given pathspec.
* dt/clean-pathspec-filter-then-lstat:
clean: only lstat files in pathspec
builtin/clean.c
patch
|
blob
|
history
raw
(from parent 1:
77bd3ea
)
diff --git
a/builtin/clean.c
b/builtin/clean.c
index 98c103fa8b4faa83c33a62e5d7871c1e9d888c38..ada0196c9e7be080847641973ddd5201534f6094 100644
(file)
--- a/
builtin/clean.c
+++ b/
builtin/clean.c
@@
-941,15
+941,15
@@
int cmd_clean(int argc, const char **argv, const char *prefix)
if (!cache_name_is_other(ent->name, ent->len))
continue;
- if (lstat(ent->name, &st))
- die_errno("Cannot lstat '%s'", ent->name);
-
if (pathspec.nr)
matches = dir_path_match(ent, &pathspec, 0, NULL);
if (pathspec.nr && !matches)
continue;
+ if (lstat(ent->name, &st))
+ die_errno("Cannot lstat '%s'", ent->name);
+
if (S_ISDIR(st.st_mode) && !remove_directories &&
matches != MATCHED_EXACTLY)
continue;