blob: 448cbc915211f9a79a09ac5741a8e2d2488fecd0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
From d2c63c32306732695b7fe5f9dda3deecb7899f4f Mon Sep 17 00:00:00 2001
From: Jiri Kyjovsky <j1.kyjovsky@gmail.com>
Date: Sat, 15 Apr 2023 13:46:21 +0200
Subject: [PATCH 4/6] Allow empty commits when `uses_rpmautospec`
To avoid situations where the command `commit` by default does
commit when no change in repo is present.
Fixes: #677
JIRA: RHELCMP-11489
Merges: https://pagure.io/rpkg/pull-request/688
Signed-off-by: Jiri Kyjovsky <j1.kyjovsky@gmail.com>
---
pyrpkg/__init__.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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:
--
2.39.2
|