Skip to content

Commit

Permalink
fix subprocess.run for progressive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyaplis committed Aug 23, 2022
1 parent 30bb3cc commit 699dee2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ansiblelint/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,18 @@ def _previous_revision() -> Iterator[None]:
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
).stdout
).stdout.strip()
path = pathlib.Path(worktree_dir)
path.mkdir(parents=True, exist_ok=True)
# Run check will fail if worktree_dir already exists
# pylint: disable=subprocess-run-check
subprocess.run(
["git", "worktree", "add", "-f", worktree_dir],
shell=True,
stderr=subprocess.DEVNULL,
check=True,
)
try:
with cwd(worktree_dir):
subprocess.run(["git", "checkout", revision], shell=True, check=True)
subprocess.run(["git", "checkout", revision], check=True)
yield
finally:
options.exclude_paths = [abspath(p, os.getcwd()) for p in rel_exclude_paths]
Expand Down

0 comments on commit 699dee2

Please sign in to comment.