output: build from files in get_obj() regardless is hash_info set

This commit is contained in:
Peter Rowlands
2023-02-03 13:23:04 +09:00
committed by Peter Rowlands (변기호)
parent 18fa1a0272
commit 25dcc33580
+8 -9
View File
@@ -869,16 +869,15 @@ class Output:
obj: Optional["HashFile"] = None
if self.obj:
obj = self.obj
elif self.files:
tree = Tree.from_list(self.files, hash_name=self.hash_name)
tree.digest()
obj = tree
elif self.hash_info:
if self.files:
tree = Tree.from_list(self.files, hash_name=self.hash_name)
tree.digest()
obj = tree
else:
try:
obj = oload(self.odb, self.hash_info)
except (FileNotFoundError, ObjectFormatError):
return None
try:
obj = oload(self.odb, self.hash_info)
except (FileNotFoundError, ObjectFormatError):
return None
else:
return None