From 1774e57b6d11039e04274c0ade9c27d2c768af09 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 5 May 2025 07:45:23 -0700 Subject: [PATCH 1/2] Call init in Indexer::new Otherwise calling `Indexer::new` as the first thing in the program will result in "no error" errors. --- src/indexer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/indexer.rs b/src/indexer.rs index ddca5fa2d5..be8618b5c6 100644 --- a/src/indexer.rs +++ b/src/indexer.rs @@ -122,6 +122,7 @@ impl<'a> Indexer<'a> { /// /// If `verify` is `false`, the indexer will bypass object connectivity checks. pub fn new(odb: Option<&Odb<'a>>, path: &Path, mode: u32, verify: bool) -> Result { + crate::init(); let path = path.into_c_string()?; let odb = odb.map(Binding::raw).unwrap_or_else(ptr::null_mut); From 7f42b7a08c2fc6fb54e107c357e2b9811e03fe9d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 5 May 2025 07:49:43 -0700 Subject: [PATCH 2/2] Clarify Indexer::new `path` parameter This updates the docs to clarify that the path is a *directory*. --- src/indexer.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/indexer.rs b/src/indexer.rs index be8618b5c6..3a3ff62a5a 100644 --- a/src/indexer.rs +++ b/src/indexer.rs @@ -118,6 +118,8 @@ impl<'a> Indexer<'a> { /// can be `None` if no thin pack is expected, in which case missing bases /// will result in an error. /// + /// `path` is the directory where the packfile should be stored. + /// /// `mode` is the permissions to use for the output files, use `0` for defaults. /// /// If `verify` is `false`, the indexer will bypass object connectivity checks.