ok/jj
1
0
Fork 0
forked from mirrors/jj

gitignore: add assertion that prefix is empty or ends with '/'

This commit is contained in:
Martin von Zweigbergk 2021-05-16 22:40:19 -07:00
parent 03ae1b747c
commit 257ea39e68

View file

@ -53,6 +53,7 @@ impl GitIgnoreLine {
}
fn parse(prefix: &str, input: &str) -> Result<Option<GitIgnoreLine>, GitIgnoreParseError> {
assert!(prefix.is_empty() || prefix.ends_with('/'));
if input.starts_with('#') {
return Ok(None);
}