Commit 3926228a authored by agable@chromium.org's avatar agable@chromium.org

Remove force push from GitCheckout.commit()

The CQ should not be able to force push -- this allows it to wipe out legitimate
commits if something goes wrong internally. This happened recently, with a CQ
commit orphaning 20 commits from the previous few days. This may have happened
any number of times previously, probably only wiping out one commit at a time,
whenever there was a race between the CQ and a developer's direct commit+push.

Repositories should also protect themselves by disallowing force push in their
ACLs.

BUG=261619

Review URL: https://codereview.chromium.org/196573041

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@258092 0039d316-1c4b-4281-b951-d872f2087c98
parent 83f4767a
......@@ -749,7 +749,7 @@ class GitCheckout(CheckoutBase):
# Push to the remote repository.
self._check_call_git(
['push', 'origin', '%s:%s' % (self.working_branch, self.remote_branch),
'--force', '--quiet'])
'--quiet'])
# Get the revision after the push.
revision = self._get_head_commit_hash()
# Switch back to the remote_branch and sync it.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment