Closed imbrish closed 4 months ago
Apparently, I have used the wrong executable to test 0.16.5
, here is the actual result for b.diff
(still not quite right):
See also a combined example c.diff
(the foo.dll
deleted, bar.dll
added and abc.dll
modified):
diff --git a/exts/foo.dll b/exts/foo.dll
deleted file mode 100644
index 4aa3244..0000000
Binary files a/exts/foo.dll and /dev/null differ
diff --git a/exts/bar.dll b/exts/bar.dll
new file mode 100644
index 0000000..cc5b40c
Binary files /dev/null and b/exts/bar.dll differ
diff --git a/exts/abc.dll b/exts/abc.dll
index 00de669..d47cd84 100644
Binary files a/exts/abc.dll and b/exts/abc.dll differ
0.16.5
03f1569:
e208f4e:
This was my first time looking at rust code, but it seems that the minus_file
and plus_file
are updated from diff --git
line at the deleted file mode
or new file mode
lines, neither of which appear for the modified library diff. Thus, the previous path values remain, and are re-used for the modified diff.
For the current HEAD
this means that (binary file)
is appended to the filename twice. I think this information should better be stored at something like self.minus_file_binary
and used when writing a new header. All of such diff data should probably be reset at each new diff header.
Anyway, why not update the file names already at diff --git
line? Could be later overwritten at ---
, +++
etc.
I have a commit in which a binary file is modified, and a new text file is added.
If I diff only the binary file, everything is good:
But if I diff it together with the text file, the label for the modified binary file becomes incorrect:
I have built
delta
from the source, commit e208f4e, but tested also for tag0.16.5
(03f1569) with the same outcome.May be related to #96 and #1502.