1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-12-15 14:11:14 +08:00

feat(add): add support for naming pinned CIDs (#10877)

* feat(add): add support for naming pinned CID

Signed-off-by: kapil <kapilsareen584@gmail.com>

* fix(add): no double pinning and simplify pin-name

- modify PinRoot to accept name parameter, eliminating double pinning
- remove automatic filename fallback logic for cleaner behavior
- only create named pins when explicitly requested via --pin-name=value
- replace NoPinName constant with idiomatic empty string literals
- Update help text and tests to reflect explicit-only behavior

* docs: changelog

* chore: lint

* test: negative case for empty pin-name

* chore: gofmt

---------

Signed-off-by: kapil <kapilsareen584@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
This commit is contained in:
Kapil Sareen
2025-08-06 05:46:16 +05:30
committed by GitHub
parent 90b73d2ad2
commit 10abb9073d
10 changed files with 86 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ func TestPathUnixFSHAMTPartial(t *testing.T) {
dir[strconv.Itoa(i)] = files.NewBytesFile([]byte(strconv.Itoa(i)))
}
r, err := a.Unixfs().Add(ctx, files.NewMapDirectory(dir), options.Unixfs.Pin(false))
r, err := a.Unixfs().Add(ctx, files.NewMapDirectory(dir), options.Unixfs.Pin(false, ""))
if err != nil {
t.Fatal(err)
}