diff --git a/core/commands/pin.go b/core/commands/pin.go index d1626c844..ba419e479 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -547,7 +547,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN default: pinType = "indirect through " + pinType } - keys[c.String()] = RefKeyObject{ + keys[c.Cid().String()] = RefKeyObject{ Type: pinType, } } diff --git a/test/sharness/t0085-pins.sh b/test/sharness/t0085-pins.sh index 9fac885e8..bdc285edb 100755 --- a/test/sharness/t0085-pins.sh +++ b/test/sharness/t0085-pins.sh @@ -45,6 +45,13 @@ test_pins() { test $(cat verify_out | wc -l) > 8 ' + test_expect_success "test pin ls hash" ' + echo $HASH_B | test_must_fail grep /ipfs && # just to be sure + ipfs pin ls $HASH_B > ls_hash_out && + echo "$HASH_B recursive" > ls_hash_exp && + test_cmp ls_hash_exp ls_hash_out + ' + test_expect_success "unpin those hashes" ' cat hashes | ipfs pin rm '