Fix initial commit page & binary munching problem#13249
Conversation
Unfortunately as a result of properly fixing ParsePatch the hack that used git show <initial_commit_id> to get the diff for this failed. This PR fixes this using the "super-secret" empty tree ref to make the diff against. Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
left a comment
There was a problem hiding this comment.
this works for me.
| if len(whitespaceBehavior) != 0 { | ||
| diffArgs = append(diffArgs, whitespaceBehavior) | ||
| } | ||
| diffArgs = append(diffArgs, "4b825dc642cb6eb9a060e54bf8d69288fbee4904") |
There was a problem hiding this comment.
This probably should be beforeCommitID?
There was a problem hiding this comment.
Nope. That is the beforecommitid in this case
The commit has no parent so we use the magic empty tree ref.
Believe it or not this is what git uses internally to generate the "diff" on the git show in cases where the commit has no parents
There was a problem hiding this comment.
We can't set this as the beforecommitid as it breaks other things lower down in the function.
Codecov Report
@@ Coverage Diff @@
## master #13249 +/- ##
==========================================
+ Coverage 42.21% 42.22% +0.01%
==========================================
Files 683 683
Lines 75458 75463 +5
==========================================
+ Hits 31851 31866 +15
+ Misses 38382 38375 -7
+ Partials 5225 5222 -3
Continue to review full report at Codecov.
|
Co-authored-by: 6543 <6543@obermui.de>
|
sorry about that ^, will not reference PRs in this manner anymore, unless necessary ofc 🚀 |
|
please send backports :) |
Backport go-gitea#13249 * Fix initial commit page Unfortunately as a result of properly fixing ParsePatch the hack that used git show <initial_commit_id> to get the diff for this failed. This PR fixes this using the "super-secret" empty tree ref to make the diff against. Signed-off-by: Andrew Thornton <art27@cantab.net> * Also fix go-gitea#13248 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update services/gitdiff/gitdiff.go Co-authored-by: 6543 <6543@obermui.de>
Backport go-gitea#13249 * Fix initial commit page Unfortunately as a result of properly fixing ParsePatch the hack that used git show <initial_commit_id> to get the diff for this failed. This PR fixes this using the "super-secret" empty tree ref to make the diff against. Signed-off-by: Andrew Thornton <art27@cantab.net> * Also fix go-gitea#13248 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update services/gitdiff/gitdiff.go Co-authored-by: 6543 <6543@obermui.de>
Backport #13249 * Fix initial commit page Unfortunately as a result of properly fixing ParsePatch the hack that used git show <initial_commit_id> to get the diff for this failed. This PR fixes this using the "super-secret" empty tree ref to make the diff against. Signed-off-by: Andrew Thornton <art27@cantab.net> * Also fix #13248 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update services/gitdiff/gitdiff.go Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de>
Backport #13249 * Fix initial commit page Unfortunately as a result of properly fixing ParsePatch the hack that used git show <initial_commit_id> to get the diff for this failed. This PR fixes this using the "super-secret" empty tree ref to make the diff against. Signed-off-by: Andrew Thornton <art27@cantab.net> * Also fix #13248 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update services/gitdiff/gitdiff.go Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de>
This PR fixes two issues:
There was a missing check to break out of the current file loop in ParsePatch
Fix #13248
Unfortunately as a result of properly fixing ParsePatch the hack that
used git show <initial_commit_id> to get the diff for this failed.
This PR fixes this using the "super-secret" empty tree ref to make the
diff against.
Signed-off-by: Andrew Thornton art27@cantab.net