mirror of
https://github.com/junegunn/fzf.git
synced 2026-03-25 18:16:58 +08:00
Revert "Use IgnoreDuplicateDirs to prevent duplicate directory traversal"
This reverts commit 6f33df755e.
This commit is contained in:
@@ -27,7 +27,6 @@ CHANGELOG
|
|||||||
- With the reduced per-entry cost, the cache now has broader coverage.
|
- With the reduced per-entry cost, the cache now has broader coverage.
|
||||||
- fish: Improved command history (CTRL-R) (#4703) (@bitraid)
|
- fish: Improved command history (CTRL-R) (#4703) (@bitraid)
|
||||||
- Bug fixes
|
- Bug fixes
|
||||||
- `--walker=follow` no longer visits the same directory more than once. This avoids effectively infinite traversal when a symlink points outside the walker root (#4710)
|
|
||||||
- Fixed AWK tokenizer not treating a new line character as whitespace
|
- Fixed AWK tokenizer not treating a new line character as whitespace
|
||||||
- Fixed `--{accept,with}-nth` removing trailing whitespaces with a non-default `--delimiter`
|
- Fixed `--{accept,with}-nth` removing trailing whitespaces with a non-default `--delimiter`
|
||||||
- Fixed OSC8 hyperlinks being mangled when the URL contains unicode characters (#4707)
|
- Fixed OSC8 hyperlinks being mangled when the URL contains unicode characters (#4707)
|
||||||
|
|||||||
@@ -269,9 +269,7 @@ func trimPath(path string) string {
|
|||||||
|
|
||||||
func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bool {
|
func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bool {
|
||||||
conf := fastwalk.Config{
|
conf := fastwalk.Config{
|
||||||
// When opts.follow is true, symlink following and loop/duplicate
|
Follow: opts.follow,
|
||||||
// detection is handled by IgnoreDuplicateDirs below.
|
|
||||||
Follow: false,
|
|
||||||
// Use forward slashes when running a Windows binary under WSL or MSYS
|
// Use forward slashes when running a Windows binary under WSL or MSYS
|
||||||
ToSlash: fastwalk.DefaultToSlash(),
|
ToSlash: fastwalk.DefaultToSlash(),
|
||||||
Sort: fastwalk.SortFilesFirst,
|
Sort: fastwalk.SortFilesFirst,
|
||||||
@@ -341,13 +339,9 @@ func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bo
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var walkFn fs.WalkDirFunc = fn
|
|
||||||
if opts.follow {
|
|
||||||
walkFn = fastwalk.IgnoreDuplicateDirs(fn)
|
|
||||||
}
|
|
||||||
noerr := true
|
noerr := true
|
||||||
for _, root := range roots {
|
for _, root := range roots {
|
||||||
noerr = noerr && (fastwalk.Walk(&conf, root, walkFn) == nil)
|
noerr = noerr && (fastwalk.Walk(&conf, root, fn) == nil)
|
||||||
}
|
}
|
||||||
return noerr
|
return noerr
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user