File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
scmrepo/git/backend/dulwich Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1919
2020from funcy import cached_property
2121
22- from scmrepo .exceptions import AuthError , CloneError , InvalidRemote , SCMError
22+ from scmrepo .exceptions import (
23+ AuthError ,
24+ CloneError ,
25+ InvalidRemote ,
26+ RevError ,
27+ SCMError ,
28+ )
2329from scmrepo .progress import GitProgressReporter
2430from scmrepo .utils import relpath
2531
@@ -721,8 +727,11 @@ def _describe(
721727 def diff (self , rev_a : str , rev_b : str , binary = False ) -> str :
722728 from dulwich .patch import write_tree_diff
723729
724- commit_a = self .repo [os .fsencode (rev_a )]
725- commit_b = self .repo [os .fsencode (rev_b )]
730+ try :
731+ commit_a = self .repo [os .fsencode (rev_a )]
732+ commit_b = self .repo [os .fsencode (rev_b )]
733+ except KeyError as exc :
734+ raise RevError ("Invalid revision" ) from exc
726735
727736 buf = BytesIO ()
728737 write_tree_diff (
You can’t perform that action at this time.
0 commit comments