Skip to content

Commit 4ee7180

Browse files
Byroncruessler
authored andcommitted
trust the baseline parser less
Be way more picky when unexpected lines show up, just to validate that we consume what's known correctly even in the face of possibly changing input.
1 parent b62f8a3 commit 4ee7180

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

gix-blame/tests/blame.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ mod baseline {
4141

4242
if skip_lines == 0 {
4343
break;
44+
} else {
45+
continue;
4446
}
4547
}
4648

@@ -69,6 +71,24 @@ mod baseline {
6971
(line_number_in_final_file - 1)..(line_number_in_final_file + number_of_lines_in_group - 1);
7072
assert!(ranges.is_none(), "should not overwrite existing ranges");
7173
ranges = Some((blame_range, original_range));
74+
} else if ![
75+
"author",
76+
"author-mail",
77+
"author-time",
78+
"author-tz",
79+
"committer",
80+
"committer-mail",
81+
"committer-time",
82+
"committer-tz",
83+
"summary",
84+
"previous",
85+
"filename",
86+
"boundary",
87+
]
88+
.contains(&fields[0])
89+
&& ObjectId::from_hex(fields[0].as_bytes()).is_err()
90+
{
91+
panic!("unexpected line: '{:?}'", line.as_bstr());
7292
}
7393
}
7494

0 commit comments

Comments
 (0)