commit e62372c880c9e8154a6e753d6685b49a3af10960
parent 18d46804696ca7686f6b66ad40773b109a40ebc6
Author: Andrew Halberstadt <ahal@mozilla.com>
Date: Thu, 2 Oct 2025 15:28:49 +0000
Bug 1986773 - [mozversioncontrol] Fetch git remotes more robustly, r=releng-reviewers,bhearsum
It's possible for output of `git remote -v` to both contain less than
three parts and more than three parts.
Differential Revision: https://phabricator.services.mozilla.com/D267064
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/python/mozversioncontrol/mozversioncontrol/repo/git.py b/python/mozversioncontrol/mozversioncontrol/repo/git.py
@@ -116,7 +116,11 @@ class GitRepository(Repository):
)
for line in remotes:
- name, url, action = line.split()
+ parts = line.split()
+ if len(parts) < 3:
+ continue
+
+ name, url, action, *_ = parts
# Only consider fetch sources.
if action != "(fetch)":