From 371800ee70974b6165aa30df729d86e11c0097dc Mon Sep 17 00:00:00 2001 From: Jiri Kyjovsky Date: Apr 15 2023 11:59:15 +0000 Subject: fix: allow empty commits when `uses_rpmautospec` To avoid situations where `commit` by default does commit when no change in repo is present. For reference, see pagure.io/rpkg/issue/677 Signed-off-by: Jiri Kyjovsky --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 0b9a869..187796e 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1867,7 +1867,9 @@ class Commands(object): # construct the git command # We do this via subprocess because the git module is terrible. - cmd = ['git', 'commit', '--allow-empty'] + cmd = ['git', 'commit'] + if not self.is_retired() and self.uses_rpmautospec: + cmd.append('--allow-empty') if signoff: cmd.append('-s') if self.quiet: