Skip to content

Commit

Permalink
fix: recover change
Browse files Browse the repository at this point in the history
  • Loading branch information
imstevez committed Sep 27, 2023
1 parent aed156b commit d8788fb
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions blocks/blockstoreutil/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func RmBlocks(ctx context.Context, blocks bs.GCBlockstore, pins pin.Pinner, cids
}

// FilterPinned takes a slice of Cids and returns it with the pinned Cids
// removed. If a CID is pinned, it will place RemovedBlock objects in the given
// out channel, with an error which indicates that the CID is pinned.
// removed. If a Cid is pinned, it will place RemovedBlock objects in the given
// out channel, with an error which indicates that the Cid is pinned.
// This function is used in RmBlocks to filter out any blocks which are not
// to be removed (because they are pinned).
func FilterPinned(ctx context.Context, pins pin.Pinner, out chan<- interface{}, cids []cid.Cid) []cid.Cid {
Expand Down
2 changes: 1 addition & 1 deletion core/commands/cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The optional format string is a printf style format string:
}

type CidFormatRes struct {
CidStr string // Original CID String passed in
CidStr string // Original Cid String passed in
Formatted string // Formatted Result
ErrorMsg string // Error
}
Expand Down
2 changes: 1 addition & 1 deletion core/commands/cmdenv/cidbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func CidBaseDefined(req *cmds.Request) bool {
}

// CidEncoderFromPath creates a new encoder that is influenced from
// the encoded CID in a Path. For CidV0 the multibase from the base
// the encoded Cid in a Path. For CidV0 the multibase from the base
// encoder is used and automatic upgrades are disabled. For CidV1 the
// multibase from the CID is used and upgrades are enabled.
//
Expand Down
2 changes: 1 addition & 1 deletion core/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sort"
"strings"

cmds "github.com/bittorrent/go-btfs-cmds"
"github.com/bittorrent/go-btfs-cmds"
)

type commandEncoder struct {
Expand Down
6 changes: 3 additions & 3 deletions core/commands/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const (
filesHashOptionName = "hash"
)

var cidVersionOption = cmds.IntOption(filesCidVersionOptionName, "cid-ver", "CID version to use. (experimental)")
var hashOption = cmds.StringOption(filesHashOptionName, "Hash function to use. Will set CID version to 1 if used. (experimental)")
var cidVersionOption = cmds.IntOption(filesCidVersionOptionName, "cid-ver", "Cid version to use. (experimental)")
var hashOption = cmds.StringOption(filesHashOptionName, "Hash function to use. Will set Cid version to 1 if used. (experimental)")

var errFormat = errors.New("format was set by multiple options. Only one format option is allowed")

Expand Down Expand Up @@ -735,7 +735,7 @@ stat' on the file or any of its ancestors.
},
Arguments: []cmds.Argument{
cmds.StringArg("path", true, false, "Path to write to."),
cmds.FileArg("data", true, false, "data to write.").EnableStdin(),
cmds.FileArg("data", true, false, "Data to write.").EnableStdin(),
},
Options: []cmds.Option{
cmds.Int64Option(filesOffsetOptionName, "o", "Byte offset to begin writing at."),
Expand Down
4 changes: 2 additions & 2 deletions core/commands/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The output is:
`,
},
Arguments: []cmds.Argument{
cmds.StringArg("obj", false, true, "CID of objects to list."),
cmds.StringArg("obj", false, true, "Cid of objects to list."),
},
Options: []cmds.Option{
cmds.BoolOption(fileOrderOptionName, "sort the results based on the path of the backing file"),
Expand Down Expand Up @@ -122,7 +122,7 @@ For ERROR entries the error will also be printed to stderr.
`,
},
Arguments: []cmds.Argument{
cmds.StringArg("obj", false, true, "CID of objects to verify."),
cmds.StringArg("obj", false, true, "Cid of objects to verify."),
},
Options: []cmds.Option{
cmds.BoolOption(fileOrderOptionName, "verify the objects based on the order of the backing file"),
Expand Down
10 changes: 5 additions & 5 deletions core/commands/object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Supported values are:
Type: Node{},
Encoders: cmds.EncoderMap{
cmds.Protobuf: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *Node) error {
// deserialize the data field as text as this was the standard behaviour
// deserialize the Data field as text as this was the standard behaviour
object, err := deserializeNode(out, "text")
if err != nil {
return nil
Expand Down Expand Up @@ -371,20 +371,20 @@ It reads from stdin, and the output is a base58 encoded multihash.
'btfs object put' is a plumbing command for storing DAG nodes.
It reads from stdin, and the output is a base58 encoded multihash.
data should be in the format specified by the --inputenc flag.
Data should be in the format specified by the --inputenc flag.
--inputenc may be one of the following:
* "protobuf"
* "json" (default)
Examples:
$ echo '{ "data": "abc" }' | btfs object put
$ echo '{ "Data": "abc" }' | btfs object put
This creates a node with the data 'abc' and no links. For an object with
links, create a file named 'node.json' with the contents:
{
"data": "another",
"Data": "another",
"Links": [ {
"Name": "some link",
"Hash": "QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V",
Expand All @@ -399,7 +399,7 @@ And then run:
},

Arguments: []cmds.Argument{
cmds.FileArg("data", true, false, "data to be stored as a DAG object.").EnableStdin(),
cmds.FileArg("data", true, false, "Data to be stored as a DAG object.").EnableStdin(),
},
Options: []cmds.Option{
cmds.StringOption(inputencOptionName, "Encoding type of input data. One of: {\"protobuf\", \"json\"}.").WithDefault("json"),
Expand Down
4 changes: 2 additions & 2 deletions core/commands/object/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ Example:
$ echo "hello" | btfs object patch $HASH append-data
NOTE: This does not append data to a file - it modifies the actual raw
data within an object. ToDeleteObjects have a max size of 1MB and objects larger than
data within an object. Objects have a max size of 1MB and objects larger than
the limit will not be respected by the network.
`,
},
Arguments: []cmds.Argument{
cmds.StringArg("root", true, false, "The hash of the node to modify."),
cmds.FileArg("data", true, false, "data to append.").EnableStdin(),
cmds.FileArg("data", true, false, "Data to append.").EnableStdin(),
},
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
api, err := cmdenv.GetApi(env, req)
Expand Down
2 changes: 1 addition & 1 deletion core/commands/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (rw *RefWriter) visit(c cid.Cid, depth int) (bool, bool) {
// Unique == true && depth < MaxDepth (or unlimited) from this point

// Branch pruning cases:
// - We saw the CID before and either:
// - We saw the Cid before and either:
// - Depth is unlimited (MaxDepth = -1)
// - We saw it higher (smaller depth) in the DAG (means we must have
// explored deep enough before)
Expand Down
2 changes: 1 addition & 1 deletion core/corehttp/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type IPFSBackend interface {
// Get returns a GetResponse with UnixFS file, directory or a block in IPLD
// format e.g., (DAG-)CBOR/JSON.
//
// Returned Directories are preferably a minimum info required for enumeration: Name, Size, and CID.
// Returned Directories are preferably a minimum info required for enumeration: Name, Size, and Cid.
//
// Optional ranges follow [HTTP Byte Ranges] notation and can be used for
// pre-fetching specific sections of a file or a block.
Expand Down
6 changes: 3 additions & 3 deletions core/corehttp/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
// assert.Contains(t, s, "<a class=\"btfs-hash\" translate=\"no\" href=\"https://cid.btfs.tech/#", "expected links to cid.btfs.tech in CID column when on DNSLink website")
// assert.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/..\">", "expected backlink in directory listing")
// assert.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/file.txt\">", "expected file in directory listing")
// assert.Contains(t, s, s, k2.CID().String(), "expected hash in directory listing")
// assert.Contains(t, s, s, k2.Cid().String(), "expected hash in directory listing")

// // make request to directory listing at root
// req, err = http.NewRequest(http.MethodGet, ts.URL, nil)
Expand All @@ -440,7 +440,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
// assert.Contains(t, s, "<a href=\"/file.txt\">", "expected file in directory listing")
// // https://github.com/btfs/dir-index-html/issues/42
// assert.Contains(t, s, "<a class=\"btfs-hash\" translate=\"no\" href=\"https://cid.btfs.tech/#", "expected links to cid.btfs.tech in CID column when on DNSLink website")
// assert.Contains(t, s, k.CID().String(), "expected hash in directory listing")
// assert.Contains(t, s, k.Cid().String(), "expected hash in directory listing")

// // make request to directory listing
// req, err = http.NewRequest(http.MethodGet, ts.URL+"/foo%3F%20%23%3C%27/bar/", nil)
Expand All @@ -460,7 +460,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
// assert.True(t, matchPathOrBreadcrumbs(s, "/btns/<a href=\"//example.net/\">example.net</a>/<a href=\"//example.net/foo%3F%20%23%3C%27\">foo? #&lt;&#39;</a>/<a href=\"//example.net/foo%3F%20%23%3C%27/bar\">bar</a>"), "expected a path in directory listing")
// assert.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/bar/..\">", "expected backlink in directory listing")
// assert.Contains(t, s, "<a href=\"/foo%3F%20%23%3C%27/bar/file.txt\">", "expected file in directory listing")
// assert.Contains(t, s, k3.CID().String(), "expected hash in directory listing")
// assert.Contains(t, s, k3.Cid().String(), "expected hash in directory listing")
// }

func TestPretty404(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions fuse/ipns/ipns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ func verifyFile(t *testing.T, path string, wantData []byte) {
t.Fatal(err)
}
if len(isData) != len(wantData) {
t.Fatal("data not equal - length check failed")
t.Fatal("Data not equal - length check failed")
}
if !bytes.Equal(isData, wantData) {
t.Fatal("data not equal")
t.Fatal("Data not equal")
}
}

Expand Down Expand Up @@ -328,7 +328,7 @@ func TestAppendFile(t *testing.T) {
t.Fatal(err)
}
if !bytes.Equal(rbuf, data) {
t.Fatal("data inconsistent!")
t.Fatal("Data inconsistent!")
}
}

Expand Down Expand Up @@ -458,7 +458,7 @@ func TestFSThrash(t *testing.T) {
}

if !bytes.Equal(data, out) {
t.Errorf("data didn't match in %s: expected %v, got %v", name, data, out)
t.Errorf("Data didn't match in %s: expected %v, got %v", name, data, out)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fuse/readonly/readonly_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
if err != nil {
return err
}
// data has a capacity of Size
// Data has a capacity of Size
buf := resp.Data[:int(req.Size)]
n, err := io.ReadFull(r, buf)
resp.Data = buf[:n]
Expand Down

0 comments on commit d8788fb

Please sign in to comment.