refactor: check if targets is instances of str (#3779)

This commit is contained in:
nik123
2020-05-11 19:10:14 +03:00
committed by GitHub
parent 9f015fac1d
commit 7f17c6aa03
5 changed files with 15 additions and 0 deletions
+3
View File
@@ -60,6 +60,9 @@ def _checkout(
stats["deleted"] = [_fspath_dir(u, self.root_dir) for u in unused]
self.state.remove_links(unused)
if isinstance(targets, str):
targets = [targets]
pairs = set()
for target in targets:
try:
+3
View File
@@ -37,6 +37,9 @@ def _fetch(
used_run_cache = self.stage_cache.pull(remote) if run_cache else []
if isinstance(targets, str):
targets = [targets]
used = self.used_cache(
targets,
all_branches=all_branches,
+3
View File
@@ -19,6 +19,9 @@ def pull(
all_commits=False,
run_cache=False,
):
if isinstance(targets, str):
targets = [targets]
processed_files_count = self._fetch(
targets,
jobs,
+3
View File
@@ -16,6 +16,9 @@ def push(
):
used_run_cache = self.stage_cache.push(remote) if run_cache else []
if isinstance(targets, str):
targets = [targets]
used = self.used_cache(
targets,
all_branches=all_branches,
+3
View File
@@ -116,6 +116,9 @@ def status(
all_commits=False,
recursive=False,
):
if isinstance(targets, str):
targets = [targets]
if cloud or remote:
return _cloud_status(
self,