Merge branch '17394-collectionfs-storage-class' into main
[arvados.git] / sdk / go / arvados / collection.go
index 030665d77f7a075f289c92d4a715f1d414de9a9b..cec20279d1fdc81cb56936ed731dea6c6a4c0e8c 100644 (file)
@@ -53,6 +53,8 @@ func (c Collection) resourceName() string {
 
 // SizedDigests returns the hash+size part of each data block
 // referenced by the collection.
+//
+// Zero-length blocks are not included.
 func (c *Collection) SizedDigests() ([]SizedDigest, error) {
        manifestText := c.ManifestText
        if manifestText == "" {
@@ -76,6 +78,10 @@ func (c *Collection) SizedDigests() ([]SizedDigest, error) {
                                // FIXME: ensure it's a file token
                                break
                        }
+                       if strings.HasPrefix(token, "d41d8cd98f00b204e9800998ecf8427e+0") {
+                               // Exclude "empty block" placeholder
+                               continue
+                       }
                        // FIXME: shouldn't assume 32 char hash
                        if i := strings.IndexRune(token[33:], '+'); i >= 0 {
                                token = token[:33+i]