Skip to content

GitIndex does not find latest versions (?) #160

Closed Answered by Byron
MingweiSamuel asked this question in Q&A
Discussion options

You must be logged in to vote

You will want to call update() to be sure it's the latest version of the Git index.

use crates_index::GitIndex;

fn main() {
    let mut index = GitIndex::new_cargo_default().unwrap();
    // ------------------------
    index.update().unwrap();
    // ------------------------
    let c = index.crate_("gix-path").unwrap();
    println!("{:#?}", c.versions().iter().map(|v| v.version()).collect::<Vec<_>>());
}

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@MingweiSamuel
Comment options

@Byron
Comment options

Byron Jan 28, 2024
Collaborator

@MingweiSamuel
Comment options

@Byron
Comment options

Byron Jan 28, 2024
Collaborator

@Byron
Comment options

Byron Jan 28, 2024
Collaborator

Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #159 on January 27, 2024 07:10.