@cryptotaxi247 / kubo / commits / e66bb9219

address review nitpicks

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Sep 5, 2017 at 21:20 UTC e66bb9219833f2b63f5303409574855fe612fa0f
1 file changed +1 -7
fuse/readonly/readonly_unix.go
+1 -7
@@ -182,16 +182,12 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
182 if len(n) == 0 {
183 n = lnk.Cid.String()
184 }
185 - // TODO: calling everything a DT_File here might cause issues. But it
186 - // will be expensive to query each child. However most shells call an
187 - // additional 'stat' on each item in a directory listing, its probably
188 - // okay.
185 nd, err := s.Ipfs.DAG.Get(ctx, lnk.Cid)
186 if err != nil {
187 log.Warning("error fetching directory child node: ", err)
188 }
189
194 - var t fuse.DirentType
190 + t := fuse.DT_Unknown
191 switch nd := nd.(type) {
192 case *mdag.RawNode:
193 t = fuse.DT_File
@@ -213,8 +209,6 @@ func (s *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
209 log.Error("unrecognized protonode data type: ", data.GetType())
210 }
211 }
216 - default:
217 - t = fuse.DT_Unknown
212 }
213 entries = append(entries, fuse.Dirent{Name: n, Type: t})
214 return nil