From fb04645b0d6242b1f75da0b2d20d3371a7a9be51 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 10 Oct 2023 23:03:47 +0200 Subject: docs(tvix/store/protos): explain a bit more what we're doing Explain a bit better what we do in the codeblock below, and add a newline to make it clear we don't just document the first branch. Change-Id: Ifb142d9984e6d2cbca648525c10298f2fcbdfedf Reviewed-on: https://cl.tvl.fyi/c/depot/+/9645 Tested-by: BuildkiteCI Reviewed-by: Brian McGee Autosubmit: flokli --- tvix/store/protos/pathinfo.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tvix') diff --git a/tvix/store/protos/pathinfo.go b/tvix/store/protos/pathinfo.go index 6607b5c879..595a1b4fab 100644 --- a/tvix/store/protos/pathinfo.go +++ b/tvix/store/protos/pathinfo.go @@ -51,7 +51,9 @@ func (p *PathInfo) Validate() (*storepath.StorePath, error) { return nil, fmt.Errorf("root node must be set") } - // ensure it properly parses to a store path, and in case it refers to a digest, ensure it has the right length. + // for all three node types, ensure the name properly parses to a store path, + // and in case it refers to a digest, ensure it has the right length. + if node := rootNode.GetDirectory(); node != nil { if len(node.Digest) != 32 { return nil, fmt.Errorf("invalid digest size for %s, expected %d, got %d", node.Name, 32, len(node.Digest)) -- cgit 1.4.1