From d7f8683daf1d47bb060a1f054453be6779accede Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 19 Nov 2020 19:18:46 -0500 Subject: [PATCH] project: do not update local published/ refs in dryrun mode Bug: https://crbug.com/gerrit/13087 Change-Id: I197e6d6d07c7d325ac294b597d42e895f77c737f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/289182 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- project.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/project.py b/project.py index 29f6b1e8..f838c6f4 100644 --- a/project.py +++ b/project.py @@ -1026,10 +1026,11 @@ class Project(object): if GitCommand(self, cmd, bare=True).Wait() != 0: raise UploadError('Upload failed') - msg = "posted to %s for %s" % (branch.remote.review, dest_branch) - self.bare_git.UpdateRef(R_PUB + branch.name, - R_HEADS + branch.name, - message=msg) + if not dryrun: + msg = "posted to %s for %s" % (branch.remote.review, dest_branch) + self.bare_git.UpdateRef(R_PUB + branch.name, + R_HEADS + branch.name, + message=msg) # Sync ## def _ExtractArchive(self, tarpath, path=None):