Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pin ls output when hash is specified #5699

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/sharness/t0085-pins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down