Commit 5cffc195 authored by Gavin Mak's avatar Gavin Mak Committed by LUCI CQ

Don't check refspecs when running git cat-file

bot_update fetches +refs/branch-heads/* but also checks git cat-file -e
+refs/branch-heads/* which fails.

Bug: 1261879
Change-Id: Ic902eebcb7301aeae32e1a8775e3babf9fdedea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3234885Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
parent 57f85818
......@@ -592,7 +592,11 @@ def _has_in_git_cache(revision_sha1, refs, git_cache_dir, url):
'cache', 'exists', '--quiet', '--cache-dir', git_cache_dir, url).strip()
if revision_sha1:
git('cat-file', '-e', revision_sha1, cwd=mirror_dir)
for ref in refs:
# Don't check refspecs.
filtered_refs = [
r for r in refs if r not in [BRANCH_HEADS_REFSPEC, TAGS_REFSPEC]
]
for ref in filtered_refs:
git('cat-file', '-e', ref, cwd=mirror_dir)
return True
except SubprocessFailed:
......@@ -637,7 +641,7 @@ def _set_git_config(fn):
with git_config_if_not_set('user.name', 'chrome-bot'), \
git_config_if_not_set('user.email', 'chrome-bot@chromium.org'), \
git_config_if_not_set('fetch.uriprotocols', 'https'):
return fn(*args, **kwargs)
return fn(*args, **kwargs)
return wrapper
......
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