We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a5ee4b commit 1f5eb8dCopy full SHA for 1f5eb8d
internal/gitfs/gitfs.go
@@ -183,13 +183,18 @@ func (g *GitFile) ReadDir(n int) ([]fs.DirEntry, error) {
183
var entries []fs.DirEntry
184
for ; g.pos < c; g.pos++ {
185
inf := g.filesys.paths[g.pos]
186
- if !strings.HasPrefix(inf.path, filepath.Join(info.path, "/")) {
+ prefix := info.path + "/"
187
+ if !strings.HasPrefix(inf.path, prefix) {
188
// Done
189
if len(entries) == 0 {
190
return nil, io.EOF
191
}
192
return entries, nil
193
194
+ // Skip files in subdirectories.
195
+ if strings.Count(inf.path[len(prefix):], "/") > 0 {
196
+ continue
197
+ }
198
entries = append(entries, &GitDirEntry{
199
filesys: g.filesys,
200
i: g.pos,
0 commit comments