Skip to content

Indexer::new() fails with message "no error" #1159

Closed
@jacks0n9

Description

@jacks0n9

Reproduction code:

use std::path::Path;

use git2::Indexer;

fn main() {
    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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions