bot_update: fix git dir check

existance of a dir does not mean it is a git repo. Check .git dir
presence instead.

This is the reason why swarmbucket build.git builds fail.

TBR=hinoka@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2174923002
changes/90/365990/1
nodir 9 years ago committed by Commit bot
parent b3a2148c42
commit cdac80c9fb

@ -834,7 +834,7 @@ def need_to_run_deps2git(repo_base, deps_file, deps_git_file):
last_known_deps_git_ref, cwd=repo_base).strip()
# If the merge base of the last DEPS and last .DEPS.git file is not
# equivilent to the hash of the last DEPS file, that means the DEPS file
# equivalent to the hash of the last DEPS file, that means the DEPS file
# was committed after the last .DEPS.git file.
return last_known_deps_ref != merge_base_ref
@ -966,7 +966,7 @@ def git_checkout(solutions, revisions, shallow, refs, git_cache_dir):
'clone', '--no-checkout', '--local', '--shared', mirror_dir, sln_dir)
try:
if not path.isdir(sln_dir):
if not path.isdir(os.path.join(sln_dir, '.git')):
git(*clone_cmd)
else:
git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir)

Loading…
Cancel
Save