From b2f75f2e6e7860a4d31bbed8b21516ec9ac2efbc Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Tue, 1 Nov 2022 15:47:02 +0900 Subject: [PATCH] commit: skip changed_entries check on force commit --- dvc/repo/commit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dvc/repo/commit.py b/dvc/repo/commit.py index d58b4775a2..c6840a9afd 100644 --- a/dvc/repo/commit.py +++ b/dvc/repo/commit.py @@ -56,10 +56,13 @@ def commit( ] for stage_info in stages_info: stage = stage_info.stage - changes = stage.changed_entries() - if any(changes): - prompt_to_commit(stage, changes, force=force) + if force: stage.save(allow_missing=allow_missing) + else: + changes = stage.changed_entries() + if any(changes): + prompt_to_commit(stage, changes, force=force) + stage.save(allow_missing=allow_missing) stage.commit( filter_info=stage_info.filter_info, allow_missing=allow_missing )