You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::path::Path;use git2::Indexer;fnmain(){Indexer::new(None,Path::new("pack-deb8057d446a5ab60cd17f2ff20862add62b883b.pack"),0,false,).unwrap();}
This code will fail, even though the pack is valid and generated by git itself. The pack used in this example has the data (here shown in base64) of: UEFDSwAAAAIAAAABNXicS0xMTOQCAAVdAY/euAV9RGpatgzRfy/yCGKt1iuIOw==
The output of running this program is the following:
thread 'main' panicked at src/main.rs:12:6:
called `Result::unwrap()` on an `Err` value: Error { code: -1, klass: 0, message: "no error" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This pack contains only one four-character blob object with the text "aaaa". This issue makes it impossible to create an indexer without an ODB for certain, but I have not tested this with an ODB.
The text was updated successfully, but these errors were encountered:
I think there might be a misunderstanding of how to use the Indexer api. The path should be a directory where the index and pack files will be stored. Then, if you have some data to write, you just use the write method of the Indexer (and then commit).
The "no error" is due to a missing call to crate::init() in the Indexer::new method. I have opened #1160 to fix that.
Reproduction code:
This code will fail, even though the pack is valid and generated by git itself. The pack used in this example has the data (here shown in base64) of:
UEFDSwAAAAIAAAABNXicS0xMTOQCAAVdAY/euAV9RGpatgzRfy/yCGKt1iuIOw==
The output of running this program is the following:
This pack contains only one four-character blob object with the text "aaaa". This issue makes it impossible to create an indexer without an ODB for certain, but I have not tested this with an ODB.
The text was updated successfully, but these errors were encountered: