From 6cfe17655701624d624d0d5d6e3a8d8d6ccb7aa5 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 20 Jul 2025 05:18:22 -0400 Subject: [PATCH] [FIX] script git_tool: return nothing when .git is not here, instead of crash --- script/git/git_tool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/git/git_tool.py b/script/git/git_tool.py index 87af464..6c69f92 100644 --- a/script/git/git_tool.py +++ b/script/git/git_tool.py @@ -258,6 +258,8 @@ class GitTool: """ lst_filter_group = filter_group.split(",") if filter_group else [] manifest_file = self.get_manifest_file(repo_path=repo_path) + if not manifest_file: + return [] if os.path.isabs(manifest_file): # This is a absolute path filename = manifest_file @@ -741,6 +743,8 @@ class GitTool: :return: manifest file used for Repo """ file = f"{repo_path}/.repo/manifest.xml" + if not os.path.exists(file): + return "" with open(file) as xml: xml_as_string = xml.read() xml_dict = xmltodict.parse(xml_as_string)