Skip to content

diff: Support diff generation with null blob IDs

Justin Tobler requested to merge jt/diff-blobs-null-oid into master

When using git-diff(1) to generate blob diffs, a null blob ID is considered a bad object. This means it is not possible to generate creation and deletion blob diffs by using a null blob ID. To workaround this limitation, objects can be diffed against an empty blob object to produce the same result. Unlike empty tree objects, empty blob objects are not special cased and not guaranteed to exist in the repository. This is handled by always staging an empty blob object in a quarantine directory and incoming diff requests with null blob IDs are rewritten to reference the empty blob object ID instead.

Related: #6097 (closed)

Edited by Justin Tobler

Merge request reports