[PATCH 2/3] Make CachedRepo.resolve_ref handle non-existent SHA1

Lars Wirzenius lars.wirzenius at codethink.co.uk
Wed Oct 23 17:29:40 BST 2013


---
 morphlib/cachedrepo.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/morphlib/cachedrepo.py b/morphlib/cachedrepo.py
index 0a085bb..cbac787 100644
--- a/morphlib/cachedrepo.py
+++ b/morphlib/cachedrepo.py
@@ -126,7 +126,10 @@ class CachedRepo(object):
         except cliapp.AppException:
             raise InvalidReferenceError(self, ref)
 
-        tree = self._show_tree_hash(absref)
+        try:
+            tree = self._show_tree_hash(absref)
+        except cliapp.AppException:
+            raise InvalidReferenceError(self, ref)
         return absref, tree
 
     def cat(self, ref, filename):
-- 
1.8.4




More information about the baserock-dev mailing list