mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 23:11:44 +01:00
refactor: check if targets is instances of str (#3779)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user