Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiffSummary list of files empty when renaming a binary #885

Open
EricFromCanada opened this issue Jan 6, 2023 · 0 comments
Open

DiffSummary list of files empty when renaming a binary #885

EricFromCanada opened this issue Jan 6, 2023 · 0 comments

Comments

@EricFromCanada
Copy link

In a Wiki.js installation using Git for storage via git-js, if a binary is renamed in the underlying repository, the change isn't noticed because DiffSummary isn't populating the files attribute.

For example, when a binary is added:

$ git diff --stat -M HEAD^ HEAD
 uploads/image.png | Bin 0 -> 119296 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

the files attribute is populated:

diff: {"files":[{"file":"uploads/image.png","before":0,"after":119296,"binary":true}],"insertions":0,"deletions":0,"changed":1}

But when the binary is renamed:

$ git diff --stat -M HEAD^ HEAD
 uploads/{image.png => image-test.png} | Bin
 1 file changed, 0 insertions(+), 0 deletions(-)

the files attribute is empty:

diff: {"files":[],"insertions":0,"deletions":0,"changed":1}

Looking at parse-diff-summary.ts, it appears to only handle the first type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant