Changes to one file · Browse files at 94fe724d9b52 Showing diff from parent db27fdc3e583 Diff from another changeset...
@@ -231,21 +231,24 @@ return []
def contains_packed(self, sha):
- """Check if a particular object is present by SHA1 and is packed."""
+ """Check if a particular object is present by SHA1 and is packed.
+
+ This does not check alternates.
+ """
for pack in self.packs:
if sha in pack:
return True
return False
def __contains__(self, sha):
- """Check if a particular object is present by SHA1 in the main or alternate stores.
+ """Check if a particular object is present by SHA1.
This method makes no distinction between loose and packed objects.
"""
if self.contains_packed(sha) or self.contains_loose(sha):
return True
for alternate in self.alternates:
- if alternate.contains_packed(sha) or alternate.contains_loose(sha):
+ if sha in alternate:
return True
return False
@@ -305,7 +308,10 @@ return itertools.chain(*iterables)
def contains_loose(self, sha):
- """Check if a particular object is present by SHA1 and is loose."""
+ """Check if a particular object is present by SHA1 and is loose.
+
+ This does not check alternates.
+ """
return self._get_loose_object(sha) is not None
def get_raw(self, name):
|
Loading...