From eb8999a86bcbfae50f27759ad4d6aead749093b6 Mon Sep 17 00:00:00 2001 From: dberenbaum Date: Tue, 31 Oct 2023 10:46:14 -0400 Subject: [PATCH] gc: force no prompts during dry run --- dvc/commands/gc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dvc/commands/gc.py b/dvc/commands/gc.py index 04b7d4d7f..52edd78c4 100644 --- a/dvc/commands/gc.py +++ b/dvc/commands/gc.py @@ -26,6 +26,10 @@ class CmdGC(CmdBase): not_in_remote=self.args.not_in_remote, ) + # Don't prompt during dry run + if self.args.dry: + self.args.force = True + if self.args.rev: self.args.num = self.args.num or 1 @@ -63,7 +67,7 @@ class CmdGC(CmdBase): logger.warning(msg) msg = "Are you sure you want to proceed?" - if not self.args.dry and not self.args.force and not ui.confirm(msg): + if not self.args.force and not ui.confirm(msg): return 1 self.repo.gc(