From: Guido Günther Date: Mon, 16 May 2022 08:36:07 +0000 (+0200) Subject: push: Limit remote check to default remote X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e135ea459c5d1a2cc7483ea91dafb1f50e457c6;p=tools%2Fgit-buildpackage.git push: Limit remote check to default remote We can't assume the user is pushing to the defaulte remote as gbp push foo is also supported hence we can't just check pristine-tar status on the default merge branch. Helps 2405e158 ("push: skip pristine-tar push if already present remotely") Gbp-Dch: Ignore --- 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: