mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
Keep local .git paths with pio run
This commit is contained in:
@@ -384,11 +384,11 @@ def _is_vcs_spec_uri(url: str | None) -> bool:
|
||||
copy or download it (PackageSpec normalizes git URLs to ``git+``).
|
||||
The .git check runs first so an un-normalized repo URL degrades to a
|
||||
failed clone and pio run, never an archive download of a repo page."""
|
||||
if not url:
|
||||
if not url or url.startswith(("file://", "symlink://")):
|
||||
return False
|
||||
if url.split("#", 1)[0].endswith(".git"):
|
||||
return True
|
||||
if url.startswith(("file://", "symlink://", "http://", "https://")):
|
||||
if url.startswith(("http://", "https://")):
|
||||
return False
|
||||
return url.startswith(_VCS_URI_PREFIXES)
|
||||
|
||||
|
||||
@@ -632,6 +632,8 @@ def test_uri_jobs_vcs_specs_installable_without_probe(tmp_path: Path) -> None:
|
||||
# downloadable archive), then drops here as derived-name
|
||||
_FakeSpec(uri="https://x/unnorm.git", name="unnorm"),
|
||||
_FakeSpec(uri="file:///local/dir", name="local"),
|
||||
# A local .git path is copied in place, never cloned
|
||||
_FakeSpec(uri="file:///local/repo.git", name="localgit"),
|
||||
_FakeSpec(uri="symlink:///local/dir", name="link"),
|
||||
],
|
||||
set(),
|
||||
|
||||
Reference in New Issue
Block a user