Page MenuHomePhabricator

Fix `arc diff` when adding large new file with new git
ClosedPublic

Authored by avivey on Jul 8 2018, 11:39 PM.
Tags
None
Referenced Files
F15485790: D19513.id46664.diff
Thu, Apr 10, 2:26 AM
F15472176: D19513.id.diff
Sat, Apr 5, 11:14 AM
F15469393: D19513.diff
Fri, Apr 4, 12:40 PM
F15456006: D19513.diff
Sun, Mar 30, 6:22 AM
F15443567: D19513.diff
Thu, Mar 27, 5:04 AM
F15423005: D19513.id.diff
Sat, Mar 22, 11:59 AM
F15392626: D19513.diff
Sat, Mar 15, 4:27 PM
F15380919: D19513.diff
Fri, Mar 14, 4:59 AM
Subscribers

Details

Summary

See https://discourse.phabricator-community.org/t/arc-not-supporting-git-2-17-1/.
When treating it a large file binary, we try to get the "old" and "new" content using git ls-tree and cat-file.
If the file is new or deleted, there is no old file, so we try to work with filename null.

Under git < 2.17.1, that gets treated as git ls-tree -- ., which falls in the next condition under "no such path".
In git 2.18, etc, this is an error.

Explicitly bail out if there is no filename.

Test Plan

Add a new, large (>4Mb) file, arc diff.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable