From da44e21b9538b51718bf19d569bebb4a515b6168 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 4 Mar 2019 19:54:51 -0800 Subject: [PATCH] feat: make ls only work for directories Long ago, `ls` was the _object_ (merkledag) level listing tool. That's no longer the case. This is a [breaking change] but I don't think anyone will object. License: MIT Signed-off-by: Steven Allen --- core/coreapi/unixfs.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index e26c755b9..7024d12f1 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -160,9 +160,6 @@ func (api *UnixfsAPI) Ls(ctx context.Context, p coreiface.Path, opts ...options. } dir, err := uio.NewDirectoryFromNode(ses.dag, dagnode) - if err == uio.ErrNotADir { - return uses.lsFromLinks(ctx, dagnode.Links(), settings) - } if err != nil { return nil, err }