History

improve path normalization; a new ignored test (#450)

Sebastian Thiel committed 4 years ago

Commit ece5a3f1 parent 5e260da3 files · +27 −3Browse files

Showing the changes to git-credentials/src/program (1 of 3 files). Show all

Unified · Split

git-credentials/src/program/cascade.rs+3−1
@@ -1,6 +1,7 @@
11 use crate::helper::Action;
22 use crate::program::Cascade;
33 use crate::{helper, protocol, Program};
4+use bstr::ByteSlice;
45
56 /// Initialization
67 impl Cascade {
@@ -52,7 +53,8 @@ impl Cascade { · 45 unmodified lines
5253 }
5354 host
5455 });
55− ctx.path = if url.path == "/" { None } else { url.path.into() };
56+ let path = url.path.trim_with(|b| b == '/');
57+ ctx.path = (!path.is_empty()).then(|| path.into());
5658 Some(ctx.clone())
5759 }
5860 _ => None,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t