git_repository: properly quote shallow argument Since fully qualified timestamps for "--shallow_since" can have a format like "1551301058 -0500" this argument needs to be quoted. Do so. This could go unnoticed, as the git_repository rule always falls back to full cloning; nevertheless, having shallow clones not working can be a huge performance impact. Change-Id: I853c128cc6413d6cb314277dbfd04c98c17f07b5 PiperOrigin-RevId: 236850530
diff --git a/tools/build_defs/repo/git.bzl b/tools/build_defs/repo/git.bzl index d766911..1c45dec 100644 --- a/tools/build_defs/repo/git.bzl +++ b/tools/build_defs/repo/git.bzl
@@ -55,10 +55,10 @@ ( cd {working_dir} && if ! ( cd '{dir_link}' && [[ "$(git rev-parse --git-dir)" == '.git' ]] ) >/dev/null 2>&1; then rm -rf '{directory}' '{dir_link}' - git clone {shallow} '{remote}' '{directory}' || git clone '{remote}' '{directory}' + git clone '{shallow}' '{remote}' '{directory}' || git clone '{remote}' '{directory}' fi git -C '{directory}' reset --hard {ref} || \ - ((git -C '{directory}' fetch {shallow} origin {ref}:{ref} || \ + ((git -C '{directory}' fetch '{shallow}' origin {ref}:{ref} || \ git -C '{directory}' fetch origin {ref}:{ref}) && git -C '{directory}' reset --hard {ref}) git -C '{directory}' clean -xdf ) """.format(