This code is used to adapt old/new paths of the new diff cache output to
the same representation that the old diff cache produces. We use this to
preserve same behaviour among existing diff cache callers. After we get
rid of the old diff cache, we could revisit this logic and update diff
cache callers to use the old/new paths of the new diff cache directly.
We extract the logic in this change because it will be reused by
multiple diff cache clients.
Change-Id: Ia5db29cd145ee7f04ef22bb6e21240ae3caa0155