summary refs log tree commit diff
path: root/ripple/fossil/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ripple/fossil/src/lib.rs')
-rw-r--r--ripple/fossil/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/ripple/fossil/src/lib.rs b/ripple/fossil/src/lib.rs
index 4d3f7b0..95dec02 100644
--- a/ripple/fossil/src/lib.rs
+++ b/ripple/fossil/src/lib.rs
@@ -56,6 +56,7 @@ impl Store {
 				Node::File(FileRef {
 					executable,
 					ident: self.write_blob(&blob),
+					size: blob.len().try_into().ok().expect("overflow"),
 				})
 			}
 			ty if ty.is_symlink() => {
@@ -142,6 +143,7 @@ pub struct DirectoryRef {
 pub struct FileRef {
 	pub ident: Digest,
 	pub executable: bool,
+	pub size: u32,
 }
 
 impl Node {
@@ -172,10 +174,15 @@ impl Directory {
 						r#ref: ident.as_bytes().to_vec(),
 					})
 				}
-				Node::File(FileRef { ident, executable }) => d.files.push(store::FileNode {
+				Node::File(FileRef {
+					ident,
+					executable,
+					size,
+				}) => d.files.push(store::FileNode {
 					name,
 					r#ref: ident.as_bytes().to_vec(),
 					executable,
+					size,
 				}),
 				Node::Link { target } => d.links.push(store::LinkNode { name, target }),
 			}
@@ -203,6 +210,7 @@ impl Directory {
 				Node::File(FileRef {
 					ident: digest_from_bytes(&child.r#ref),
 					executable: child.executable,
+					size: child.size,
 				}),
 			);
 		}