Opened 3 years ago
GitNode *must* throw NoSuchNode on invalid revisions for Bitten to work
|Reported by:||dvdkhlng||Owned by:||hvr|
When git revisions are lost in a repository (due to rebases or whatever), and the Bitten plugin already had build such a revisions, then it will later die with a NoSuchChangeset excption while showing the Timeline.
A very similar probmlem existed for Bitten (see Bitten ticket 606) with SVN repositories and was fixed already. However that fix does not generalize to Git repositories, as GitNode.__init_ (called from GitRepository.get_node) does not throw NoSuchNode on invalid revisions if path is '/' (it does throw for all paths != '/').
So Bitten calls repo.get_node with an invalid revision, which succeeds (this part is try/catch protected). And later dies when calling repo.normalize_rev (this part is not protected).
What would be the correct fix? Is it sufficient to pull the ls_tree_info assignment and result check out of the if p: block in the GitNode constructor?