Skip to content

Commit c81b770

Browse files
committed
GitPlugin: raise NoSuchNode exception when path can't be found during node construction (addresses #2671)
1 parent 901c16b commit c81b770

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitplugin/git_fs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ def __init__(self, git, path, rev, tree_ls_info=None):
167167
else:
168168
tree_ls_info = None
169169

170-
if tree_ls_info != None:
171-
(self.perm,k,self.sha,fn) = tree_ls_info
172-
else:
173-
k = 'blob'
170+
if tree_ls_info is None:
171+
raise NoSuchNode(path, rev)
172+
173+
(self.perm,k,self.sha,fn) = tree_ls_info
174174

175175
rev=self.git.last_change(rev, p)
176176

0 commit comments

Comments
 (0)