Merge pull request #5699 from ipfs/fix/pin-ls-output

Fix pin ls output when hash is specified
This commit is contained in:
Steven Allen 2018-10-30 07:52:19 -07:00 committed by GitHub
commit 8543e27e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -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,
}
}

View File

@ -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
'