From a509f6ccd29b84c2fb894c9d72f00553fbbc7ce5 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 9 Nov 2021 17:14:08 +1300 Subject: [PATCH] Fix when package url has no branch/ref (#2683) --- esphome/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/git.py b/esphome/git.py index b64aa6a864..25d893b2f5 100644 --- a/esphome/git.py +++ b/esphome/git.py @@ -40,7 +40,7 @@ def clone_or_update( ) -> Path: key = f"{url}@{ref}" repo_dir = _compute_destination_path(key, domain) - fetch_pr_branch = ref.startswith("pull/") + fetch_pr_branch = ref is not None and ref.startswith("pull/") if not repo_dir.is_dir(): _LOGGER.info("Cloning %s", key) _LOGGER.debug("Location: %s", repo_dir)