Skip to content

Unexpected Deleted event for crate "dl" #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonhoo opened this issue Sep 13, 2022 · 3 comments
Closed

Unexpected Deleted event for crate "dl" #20

jonhoo opened this issue Sep 13, 2022 · 3 comments
Assignees

Comments

@jonhoo
Copy link

jonhoo commented Sep 13, 2022

With this program:

use crates_index_diff::{Change, Index};

fn main() {
    let index = Index::from_path_or_cloned("crates.io-index").unwrap();
    let changes = index
        .changes(
            "feeacd1f399c353d020e7b9e0ddaf4b0628f9476",
            "c3d8f6d10335e8eb076dd594ec6d82e3f58ba24a",
        )
        .unwrap();
    for change in changes {
        match &change {
            Change::Added(cv) if cv.name == "dl" => {}
            Change::Yanked(cv) if cv.name == "dl" => {}
            Change::Deleted { name, .. } if name == "dl" => {}
            _ => continue,
        }

        eprintln!("{:?}", change);
    }
}

I get the result:

$ git clone "https://github.com/rust-lang/crates.io-index.git"
$ cargo run --release
...
     Running `target/release/deleted-unexpectedly`
Deleted { name: "dl" }

However, dl is present in both commits (in from / in to) with no changes in between.

@jonhoo
Copy link
Author

jonhoo commented Sep 13, 2022

Now, I know there's a commit doing deletions in between (this one), but it doesn't touch dl as far as I can tell.

@Byron Byron self-assigned this Sep 14, 2022
Byron added a commit that referenced this issue Sep 14, 2022
Previously deleted directories would be picked up as crate deletions,
with the crate name being the deleted directory.

Now only file deletions will be assumed to be crate deletions.
@Byron
Copy link
Owner

Byron commented Sep 14, 2022

Thanks a lot for letting me know, great catch!

I could reproduce the issue and fix it, with a new patch release to incorporate the change.

@Byron Byron closed this as completed Sep 14, 2022
@jonhoo
Copy link
Author

jonhoo commented Sep 14, 2022

Excellent, thanks for the quick turnaround on a fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants