◐ Shell
clean mode source ↗

Fix Tree.Prototype.entryById and .getEntry by miachenmtl · Pull Request #1731 · nodegit/nodegit

I was experiencing a bug where Entry.prototype.path() was not working when a tree entry was fetched using Tree.prototype.entryById. This PR should resolve the bug. I also noticed that entryByPath had the same problem, but in this case, getEntry adds the necessary properties, so I renamed entryByPath to _entryByPath following the same pattern as entryByName and _entryByName.

  • entryById now follows pattern of entryByName and entryByIndex where the parent property is added to the entry. The description notes that it does not recurse.
  • entryByPath renamed to _entryByPath since getEntry should be used instead.
  • Simple test for entryById added.
  • Setup of commits used in test for TreeEntry.walk moved to test setup so getEntry can test searching by path as well.