Open correabuscar opened 2 months ago
ok I see this was on purpose, so what I want (which I'll do locally) is:
diff --git a/src/patch/format.rs b/src/patch/format.rs
index ec998a80f076016f..2a606b3e321f0349 100644
--- a/src/patch/format.rs
+++ b/src/patch/format.rs
@@ -231,12 +231,8 @@
write!(w, "{}", style.prefix())?;
}
- if sign == ' ' && line == b"\n" {
- w.write_all(line)?;
- } else {
write!(w, "{}", sign)?;
w.write_all(line)?;
- }
if self.f.with_color {
write!(w, "{}", style.suffix())?;
@@ -263,11 +259,7 @@
write!(f, "{}", style.prefix())?;
}
- if sign == ' ' && *line == "\n" {
- write!(f, "{}", line)?;
- } else {
write!(f, "{}{}", sign, line)?;
- }
if self.f.with_color {
write!(f, "{}", style.suffix())?;
on gnu
diff
andgit diff
every empty context line has one space as the prefix for the line, thus the line isn't empty in the patch itself, for example:(to see this, start selecting with the mouse from
3
to-4
, u'll see the extra space)gnu diff:
git diff:
diffy:
However applying the patch works fine with either empty context line or prefixed with space context line. (at least, gnu
patch
does)