flosse
1
How can I get the hash for a SourceId that is used in ~/.cargo/git/checkouts/?
Or in other words:
How can I get the path to the git sources of a dependency defined in a Cargo.lock file?
I tried:
let source_id = SourceId::from_url(source).unwrap();
let hash = cargo::util::hex::short_hash(&source_id);
But this is different from what I found in the filesystem.
I think you have to use SourceId::from_git with the git repo url (not the file path) and the git reference (commit id, branch name, ...) as argument.
@bjorn3 there is no SourceId::from_git but SourceId::for_git that do not create the expected hash 
I found it!
It's the ident function that is not public but easy to copy 
system
Closed
5
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.