From 25dcc3358022eb94c20845e4084785030f528d2e Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Thu, 2 Feb 2023 17:52:16 +0900 Subject: [PATCH] output: build from files in get_obj() regardless is hash_info set --- dvc/output.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dvc/output.py b/dvc/output.py index 7a3393f3c..4248b2723 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -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