11use std:: fmt:: { self , Debug , Formatter } ;
2- use std:: hash:: { Hash , Hasher , SipHasher } ;
32
43use url:: Url ;
54
65use core:: source:: { Source , SourceId } ;
76use core:: GitReference ;
87use core:: { Package , PackageId , Summary , Registry , Dependency } ;
9- use util:: { CargoResult , Config , to_hex} ;
8+ use util:: { CargoResult , Config } ;
9+ use util:: hex:: short_hash;
1010use sources:: PathSource ;
1111use sources:: git:: utils:: { GitRemote , GitRevision } ;
1212
@@ -57,8 +57,6 @@ impl<'cfg> GitSource<'cfg> {
5757}
5858
5959fn ident ( url : & Url ) -> String {
60- let mut hasher = SipHasher :: new_with_keys ( 0 , 0 ) ;
61-
6260 let url = canonicalize_url ( url) ;
6361 let ident = url. path_segments ( ) . and_then ( |mut s| s. next_back ( ) ) . unwrap_or ( "" ) ;
6462
@@ -68,8 +66,7 @@ fn ident(url: &Url) -> String {
6866 ident
6967 } ;
7068
71- url. hash ( & mut hasher) ;
72- format ! ( "{}-{}" , ident, to_hex( hasher. finish( ) ) )
69+ format ! ( "{}-{}" , ident, short_hash( & url) )
7370}
7471
7572// Some hacks and heuristics for making equivalent URLs hash the same
0 commit comments