Skip to content

Commit 68a6f3f

Browse files
committed
Extract is_known_header_field
1 parent 5e35863 commit 68a6f3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gix-blame/tests/blame.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ mod baseline {
3434
"filename",
3535
];
3636

37+
fn is_known_header_field(field: &&str) -> bool {
38+
HEADER_FIELDS.contains(field)
39+
}
40+
3741
impl<'a> Baseline<'a> {
3842
pub fn collect(baseline_path: impl AsRef<Path>) -> std::io::Result<Vec<BlameEntry>> {
3943
let content = std::fs::read(baseline_path)?;
@@ -89,7 +93,7 @@ mod baseline {
8993
(line_number_in_final_file - 1)..(line_number_in_final_file + number_of_lines_in_group - 1);
9094
assert!(ranges.is_none(), "should not overwrite existing ranges");
9195
ranges = Some((blame_range, original_range));
92-
} else if !HEADER_FIELDS.contains(&fields[0]) && ObjectId::from_hex(fields[0].as_bytes()).is_err() {
96+
} else if !is_known_header_field(&fields[0]) && ObjectId::from_hex(fields[0].as_bytes()).is_err() {
9397
panic!("unexpected line: '{:?}'", line.as_bstr());
9498
}
9599
}

0 commit comments

Comments
 (0)