data status: handle path joining properly for tree leaves/items #8107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were only joining paths when
new_objwas a tree. But technically they could be absent from the workspace or cache which prevented from path joining, hence all of the items inside a tree would show up with the root's name. Now, we check for either-or.Fixes #8053.
Another tricky thing here that I have ignored for now is, what happens if the old obj was a tree and the new obj is a hashfile? Currently
diffdoes not work with non-tree objects (i.e. hashfile), so we'd have to handle that here if we decided to support this (which we should but not here).