Index: gclient_scm.py |
diff --git a/gclient_scm.py b/gclient_scm.py |
index 4e3ab8264a81dd9de4ea246c02b18014354331e2..038a932de12f6ccec76fd7752f836238dc01d7a9 100644 |
--- a/gclient_scm.py |
+++ b/gclient_scm.py |
@@ -456,13 +456,46 @@ class GitWrapper(SCMWrapper): |
self._CheckClean(rev_str) |
# Switch over to the new upstream |
self._Run(['remote', 'set-url', self.remote, url], options) |
+ self.Print("remote is set", revision, self.url) |
if mirror: |
with open(os.path.join( |
self.checkout_path, '.git', 'objects', 'info', 'alternates'), |
'w') as fh: |
fh.write(os.path.join(url, 'objects')) |
+ try: |
+ self._Capture(['rev-list', '-n', '1', 'HEAD']) |
+ except subprocess2.CalledProcessError as e: |
+ if ('fatal: bad object HEAD' in e.stderr |
+ and self.cache_dir and self.cache_dir in url): |
+ self.Print("tAndrii31", "gotcha") |
Adrian Kuegel
2015/08/21 15:35:58
Do you want to keep this in?
tandrii(chromium)
2015/08/21 15:40:14
nope, but it's helpful to distinguish the cases du
|
+ self.Print(( |
+ 'Likely due to DEPS change with git cache_dir, ' |
+ 'the current commit points to no longer existing object.\n' |
+ '%s' % e) |
+ ) |
+ self._DeleteOrMove(options.force) |
+ self._Clone(revision, url, options) |
+ else: |
+ raise |
self._FetchAndReset(revision, file_list, options) |
+ |
return_early = True |
+ else: |
+ try: |
+ self._Capture(['rev-list', '-n', '1', 'HEAD']) |
+ except subprocess2.CalledProcessError as e: |
+ if ('fatal: bad object HEAD' in e.stderr |
+ and self.cache_dir and self.cache_dir in url): |
+ self.Print("tAndrii41", "gotcha") |
Adrian Kuegel
2015/08/21 15:35:58
Same question as above.
tandrii(chromium)
2015/08/21 15:40:14
Done.
|
+ self.Print(( |
+ 'Likely due to DEPS change with git cache_dir, ' |
+ 'the current commit points to no longer existing object.\n' |
+ '%s' % e) |
+ ) |
+ self._DeleteOrMove(options.force) |
+ self._Clone(revision, url, options) |
+ else: |
+ raise |
if return_early: |
return self._Capture(['rev-parse', '--verify', 'HEAD']) |