File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ UNRELEASED]
99
10+ ### Fixed
11+
12+ - Handle case where parse fails on invalid port ([ #50 ] ( https://github.com/tjtelan/git-url-parse-rs/issues/50 ) )
13+
14+ ## [ 0.4.3] ( https://github.com/tjtelan/git-url-parse-rs/tree/v0.4.3 ) - 2022-10-11
15+
1016### Added
1117
1218- Add short git URL notation support ([ #28 ] ( https://github.com/tjtelan/git-url-parse-rs/issues/28 ) )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ license = "MIT"
99name = " git-url-parse"
1010readme = " README.md"
1111repository = " https://github.com/tjtelan/git-url-parse-rs"
12- version = " 0.4.3 "
12+ version = " 0.4.4 "
1313
1414[dependencies ]
1515tracing = " 0.1"
Original file line number Diff line number Diff line change @@ -388,8 +388,7 @@ pub fn normalize_url(url: &str) -> Result<Url> {
388388 }
389389 }
390390 }
391- Err ( _e) => {
392- // e will most likely be url::ParseError::RelativeUrlWithoutBase
391+ Err ( url:: ParseError :: RelativeUrlWithoutBase ) => {
393392 // If we're here, we're only looking for Scheme::Ssh or Scheme::File
394393
395394 // Assuming we have found Scheme::Ssh if we can find an "@" before ":"
@@ -411,5 +410,8 @@ pub fn normalize_url(url: &str) -> Result<Url> {
411410 }
412411 }
413412 }
413+ Err ( err) => {
414+ return Err ( eyre ! ( "url parsing failed: {:?}" , err) ) ;
415+ }
414416 } )
415417}
Original file line number Diff line number Diff line change @@ -367,6 +367,18 @@ fn ssh_without_organization() {
367367 assert_eq ! ( parsed, expected) ;
368368}
369369
370+ #[ test]
371+ fn bad_port_number ( ) {
372+ let test_url = "https://github.com:crypto-browserify/browserify-rsa.git" ;
373+ let e = GitUrl :: parse ( test_url) ;
374+
375+ assert ! ( e. is_err( ) ) ;
376+ assert_eq ! (
377+ format!( "{}" , e. err( ) . unwrap( ) ) ,
378+ "Url normalization into url::Url failed"
379+ ) ;
380+ }
381+
370382#[ test]
371383fn git ( ) {
372384 let test_url = "git:github.com/owner/name.git" ;
You can’t perform that action at this time.
0 commit comments