aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@debian.org>2022-04-23 09:02:10 -0300
committerGuido Günther <agx@sigxcpu.org>2022-04-23 15:49:35 +0200
commit2405e15805c68b53628cb4fb55e1e6313c8e114c (patch)
tree6772e0374ad73b81f9c29bc6138e30d7c3e11bbd
parent6733ab9603773281016812c34604aa3358fbdc34 (diff)
push: skip pristine-tar push if already present remotely
When one is working on an older branch (stable update or backport), the pristine-tar branch may already contain new commits after the one corresponding to the upstream version in question. Closes: #1001163
-rwxr-xr-xgbp/scripts/push.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/scripts/push.py b/gbp/scripts/push.py
index d6876e26..63a06a20 100755
--- a/gbp/scripts/push.py
+++ b/gbp/scripts/push.py
@@ -172,8 +172,10 @@ def main(argv):
if options.pristine_tar:
commit, _ = repo.get_pristine_tar_commit(source)
if commit:
- ref = 'refs/heads/pristine-tar'
- to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
+ target = repo.get_merge_branch('pristine-tar')
+ if not repo.branch_contains(target, commit, remote=True):
+ ref = 'refs/heads/pristine-tar'
+ to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
if do_push(repo, [dest], to_push, dry_run=options.dryrun):
retval = 0