From 8dd354610fbe5f8f0609040260aee6a87471e947 Mon Sep 17 00:00:00 2001 From: "szager@chromium.org" Date: Mon, 8 Jun 2015 22:56:05 +0000 Subject: [PATCH] Update .git/objects/info/alternates when upstream url changes. BUG=497943 R=hinoka@chromium.org,agable@chromium.org Review URL: https://codereview.chromium.org/1163403003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295568 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gclient_scm.py b/gclient_scm.py index cf19e350d..9baa6f48c 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -452,6 +452,11 @@ class GitWrapper(SCMWrapper): self._CheckClean(rev_str) # Switch over to the new upstream self._Run(['remote', 'set-url', self.remote, url], options) + if mirror: + with open(os.path.join( + self.checkout_path, '.git', 'objects', 'info', 'alternates'), + 'w') as fh: + fh.write(os.path.join(url, 'objects')) self._FetchAndReset(revision, file_list, options) return_early = True