This instance was upgraded to Heptapod 0.27.2 on 2021-12-08 at 22:00 UTC+1

Commit b8a36ec3 authored by Simon Sapin's avatar Simon Sapin
Browse files

rhg: check that .hg/requires is ASCII

parent 5a078cf4b849
Pipeline #13306 failed with stage
in 21 minutes and 4 seconds
...@@ -24,7 +24,7 @@ fn parse(bytes: &[u8]) -> Result<Vec<String>, ()> { ...@@ -24,7 +24,7 @@ fn parse(bytes: &[u8]) -> Result<Vec<String>, ()> {
.map(|line| { .map(|line| {
// Python uses Unicode `str.isalnum` but feature names are all // Python uses Unicode `str.isalnum` but feature names are all
// ASCII // ASCII
if line[0].is_ascii_alphanumeric() { if line[0].is_ascii_alphanumeric() && line.is_ascii() {
Ok(String::from_utf8(line.into()).unwrap()) Ok(String::from_utf8(line.into()).unwrap())
} else { } else {
Err(()) Err(())
......
...@@ -140,3 +140,8 @@ Requirements ...@@ -140,3 +140,8 @@ Requirements
sparserevlog sparserevlog
store store
indoor-pool indoor-pool
$ echo -e '\xFF' >> .hg/requires
$ rhg debugrequirements
abort: .hg/requires is corrupted
[255]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment