Add --git-cache-dir option in cbuildbot.

When --git-cache-dir is specified, use 'repo sync
--cache-dir=git_cache_dir' to fetch git caches and bootstrap projects.

BUG=chromium:632203
TEST=run local cbuildbot with --git-cache-dir enabled.

Change-Id: If8a28d5213e1ce4e868efd6ca0b205184c951a27
Reviewed-on: https://chromium-review.googlesource.com/387106
Commit-Ready: Ningning Xia <nxia@chromium.org>
Tested-by: Ningning Xia <nxia@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index ec20ebc..0ece3d1 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -623,6 +623,12 @@
                           help=('Used with manifest logic.  Forces use of this '
                                 'version rather than create or get latest. '
                                 'Examples: 4815.0.0-rc1, 4815.1.2'))
+  group.add_remote_option('--git-cache-dir', dest='git_cache_dir', default=None,
+                          help=('Specify the cache directory to store the '
+                                'project caches populated by the git-cache '
+                                'tool. Bootstrap the projects based on the git '
+                                'cache files instead of fetching them directly '
+                                'from the GoB servers.'))
 
   parser.add_option_group(group)