vcs: raise better exception if file node history cannot be extracted.
reference: #4664
This commit is contained in:
parent
9e9d94b8cf
commit
6c9444d018
1 changed files with 7 additions and 1 deletions
|
|
@ -830,7 +830,13 @@ class BaseCommit(object):
|
|||
|
||||
:param pre_load: Optional. List of commit attributes to load.
|
||||
"""
|
||||
return self.get_file_history(path, limit=1, pre_load=pre_load)[0]
|
||||
commits = self.get_file_history(path, limit=1, pre_load=pre_load)
|
||||
if not commits:
|
||||
raise RepositoryError(
|
||||
'Failed to fetch history for path {}. '
|
||||
'Please check if such path exists in your repository'.format(
|
||||
path))
|
||||
return commits[0]
|
||||
|
||||
def get_file_history(self, path, limit=None, pre_load=None):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue