aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-12-23 21:06:34 +0100
committerGuido Günther <agx@sigxcpu.org>2016-12-23 21:20:36 +0100
commite31f15bf50d956267182512d6c5febb26812ad1a (patch)
treec5079082abe627485bcb9d5e21a295d773a0e376 /gbp
parent7b297b719f1a0318b07675dab186cb2ab6459bc5 (diff)
pq: Don't fail --commit on empty commits
So far we would fail empty commits with the confusing error $ gbp pq export --commit gbp:info: Generating patches from git (debian/sid..patch-queue/debian/sid) gbp:error: Error running git commit:
Diffstat (limited to 'gbp')
-rwxr-xr-xgbp/scripts/pq.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py
index 945cf1ed..37968edd 100755
--- a/gbp/scripts/pq.py
+++ b/gbp/scripts/pq.py
@@ -168,8 +168,10 @@ def commit_patches(repo, branch, patches, options, patch_dir):
# FIXME: handle case were only the contents of the patches changed
added, removed = compare_series(oldpatches, newpatches)
msg = format_series_diff(added, removed, options)
- repo.add_files(PATCH_DIR)
- repo.commit_staged(msg=msg)
+
+ if not repo.is_clean(paths='debian/patches')[0]:
+ repo.add_files(PATCH_DIR)
+ repo.commit_staged(msg=msg)
return added, removed