aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/push.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/push.py')
-rwxr-xr-xgbp/scripts/push.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/gbp/scripts/push.py b/gbp/scripts/push.py
index 494d7eb2..f1c7a59d 100755
--- a/gbp/scripts/push.py
+++ b/gbp/scripts/push.py
@@ -172,11 +172,16 @@ def main(argv):
if options.pristine_tar:
commit, _ = repo.get_pristine_tar_commit(source)
if commit:
- target = repo.get_merge_branch('pristine-tar')
- if not repo.branch_contains(target, commit, remote=True):
- ref = 'refs/heads/pristine-tar'
+ ref = 'refs/heads/pristine-tar'
+ # If we push to the default we only push if our notion of the remote
+ # branch doesn't have the commit already (See #1001163)
+ if dest == get_remote(repo, repo.branch):
+ target = repo.get_merge_branch('pristine-tar')
+ if not repo.branch_contains(target, commit, remote=True):
+ to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
+ else:
+ # TODO: Needs to check remote first, (See #1001163)
to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
-
if do_push(repo, [dest], to_push, dry_run=options.dryrun):
retval = 0
else: