Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gix-diff/src/blob/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ pub mod prepare_diff {
/// Use it in [`Platform::prepare_diff_command`](super::Platform::prepare_diff_command()) to easily prepare a compatible invocation.
command: &'a BStr,
},
/// One of the involved resources, [`old`](Outcome::old) or [`new`](Outcome::new), were binary and thus no diff
/// cannot be performed.
/// One of the involved resources, [`old`](Outcome::old) or [`new`](Outcome::new), was binary and thus no diff
/// can be performed.
SourceOrDestinationIsBinary,
}

Expand Down
15 changes: 14 additions & 1 deletion gix-diff/tests/diff/blob/slider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,20 @@ mod baseline {
hunk_lines.extend_from_slice(line);
hunk_lines.push(b'\n');
}
_ => unreachable!("BUG: expecting unified diff format"),
b'\\' => {
if line == "\\ No newline at end of file".as_bytes() {
// Do nothing.
} else {
unreachable!(
"BUG: expecting unified diff format, found line: `{}`",
line.to_str_lossy()
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should just be an assert! with message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes a lot of sense, thanks for the suggestion!

}
_ => unreachable!(
"BUG: expecting unified diff format, found line: `{}`",
line.to_str_lossy()
),
}

match self.lines.peek() {
Expand Down
2 changes: 1 addition & 1 deletion tests/it/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub enum Subcommands {
/// platforms (at least Windows) do not have such permissions, but Git still represents them.
///
/// This currently only checks files name with an `.sh` suffix, and only operates on the
/// current repository. Its main use is checking that fixture scripts are have correct modes.
/// current repository. Its main use is checking that fixture scripts have correct modes.
#[clap(visible_alias = "cm")]
CheckMode {},
/// Print environment variables as `NAME=value` lines.
Expand Down
Loading