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
7
7
8
8
## [ UNRELEASED]
9
9
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
+
10
16
### Added
11
17
12
18
- 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"
9
9
name = " git-url-parse"
10
10
readme = " README.md"
11
11
repository = " https://github.com/tjtelan/git-url-parse-rs"
12
- version = " 0.4.3 "
12
+ version = " 0.4.4 "
13
13
14
14
[dependencies ]
15
15
tracing = " 0.1"
Original file line number Diff line number Diff line change @@ -388,8 +388,7 @@ pub fn normalize_url(url: &str) -> Result<Url> {
388
388
}
389
389
}
390
390
}
391
- Err ( _e) => {
392
- // e will most likely be url::ParseError::RelativeUrlWithoutBase
391
+ Err ( url:: ParseError :: RelativeUrlWithoutBase ) => {
393
392
// If we're here, we're only looking for Scheme::Ssh or Scheme::File
394
393
395
394
// Assuming we have found Scheme::Ssh if we can find an "@" before ":"
@@ -411,5 +410,8 @@ pub fn normalize_url(url: &str) -> Result<Url> {
411
410
}
412
411
}
413
412
}
413
+ Err ( err) => {
414
+ return Err ( eyre ! ( "url parsing failed: {:?}" , err) ) ;
415
+ }
414
416
} )
415
417
}
Original file line number Diff line number Diff line change @@ -367,6 +367,18 @@ fn ssh_without_organization() {
367
367
assert_eq ! ( parsed, expected) ;
368
368
}
369
369
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
+
370
382
#[ test]
371
383
fn git ( ) {
372
384
let test_url = "git:github.com/owner/name.git" ;
You can’t perform that action at this time.
0 commit comments