@cryptotaxi247 / kubo / commits / 08d6e7844

fix pin ls output when hash is specified

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>

Łukasz Magiera committed Oct 30, 2018 at 15:26 UTC 08d6e7844a0597d499ad19324e7269ab70340a4b
2 files changed +8 -1
core/commands/pin.go
+1 -1
@@ -547,7 +547,7 @@ func pinLsKeys(ctx context.Context, args []string, typeStr string, n *core.IpfsN
547 default:
548 pinType = "indirect through " + pinType
549 }
550 - keys[c.String()] = RefKeyObject{
550 + keys[c.Cid().String()] = RefKeyObject{
551 Type: pinType,
552 }
553 }
test/sharness/t0085-pins.sh
+7
@@ -45,6 +45,13 @@ test_pins() {
45 test $(cat verify_out | wc -l) > 8
46 '
47
48 + test_expect_success "test pin ls hash" '
49 + echo $HASH_B | test_must_fail grep /ipfs && # just to be sure
50 + ipfs pin ls $HASH_B > ls_hash_out &&
51 + echo "$HASH_B recursive" > ls_hash_exp &&
52 + test_cmp ls_hash_exp ls_hash_out
53 + '
54 +
55 test_expect_success "unpin those hashes" '
56 cat hashes | ipfs pin rm
57 '