Skip to content

Commit

Permalink
walker: Do not treat '..' as a hidden entry
Browse files Browse the repository at this point in the history
Thanks to @LangLangBart for the suggested fix

Fix #4048
  • Loading branch information
junegunn committed Oct 25, 2024
1 parent 3c40b1b commit d65c610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string) bool
isDir := de.IsDir()
if isDir || opts.follow && isSymlinkToDir(path, de) {
base := filepath.Base(path)
if !opts.hidden && base[0] == '.' {
if !opts.hidden && base[0] == '.' && base != ".." {
return filepath.SkipDir
}
for _, ignore := range ignores {
Expand Down

0 comments on commit d65c610

Please sign in to comment.