Closed as-cii closed 5 years ago
Previously, when a rename occurred, it was impossible to determine the original path of a file.
With this pull request, when calling WorkTree.prototype.entries, each entry will now contain a basePath field that can either be:
WorkTree.prototype.entries
basePath
null
Path
Entry
This will be useful when an external index that exposes a diff-based interface needs to be kept up-to-date, e.g.:
if (entry.basePath) { if (entry.visible) { index.rename(entry.basePath, entry.path); } else { index.remove(entry.basePath); } }
Previously, when a rename occurred, it was impossible to determine the original path of a file.
With this pull request, when calling
WorkTree.prototype.entries
, each entry will now contain abasePath
field that can either be:null
value indicating that the file didn't exist in the base commit.Path
representing the original location where the currentEntry
was at in the base commit.This will be useful when an external index that exposes a diff-based interface needs to be kept up-to-date, e.g.: