-
Bug
-
Resolution: Fixed
-
Low
-
7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.4.0, 7.5.0
-
None
-
1
-
Severity 3 - Minor
-
2
-
Issue Summary
Viewing the diff of a text file that also contains a NULL byte can fail.
Steps to Reproduce
- Create a text file and commit it
printf '0%.0s' {1..8200} > file && git add file && git commit -m'Committed file'
- Add a NULL byte after 8200 bytes somewhere in the file and commit
printf '\0' >> file && git commit -am'Added NULL byte'
- Push to Bitbucket
- View the diff of the commit
Expected Results
The diff is displayed correctly
Actual Results
About 50% of the time, the diff of the file is not shown and a spinner is displayed indefinitely.
The below message is logged in the atlassian-bitbucket.log file (with debug logging enabled):
2020-09-02 15:54:33,048 DEBUG [http-nio-7990-exec-3] admin @R62JNHx954x834x1 1rqr69w 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PROJECT_1/repos/test/commits/d05b6df9815f3125192b9c5cdc344d7c04ac5ace/diff/file HTTP/1.1" c.a.b.i.p.nu.NioNuProcessHandler [/usr/local/bin/git diff -C --color=never -U10 --dst-prefix=dst:// --src-prefix=src:// a270f5e93c74d1389ef5483e0fb6ccd5cd319e94 d05b6df9815f3125192b9c5cdc344d7c04ac5ace -- file]: Dropping callback invocation (Canceled: true; Timed out: false)
The above message does not necessarily always indicate a problem and can occur during normal operation, such as when a diff is truncated intentionally. It is just a symptom of this bug.
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available.