Create "git cache" command.
The git cache command is a central place to manage a machine's git cache.
It provides two subcommands:
* populate -- creates or updates the cache of a given repository
* exists -- prints the path to the cache of a repo, if it exists
Gclient, deps2git, bot_update, and any other tools that touch the cache will
be able to use this command to make sure that everyone is interacting with
the cache in the same way.
[email protected], [email protected]
BUG=339168
Review URL: https://codereview.chromium.org/164823002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253007 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git-cache b/git-cache
new file mode 100755
index 0000000..14ffa60
--- /dev/null
+++ b/git-cache
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# git-cache -- a git-command for managing local caches of remote repositories.
+
+# Test if this script is running under a MSys install. If it is, we will
+# hardcode the path to Python where possible.
+OUTPUT="$(uname | grep 'MINGW')"
+MINGW=$?
+
+if [ $MINGW = 0 ]; then
+ base_dir="${0%\\*}"
+else
+ base_dir=$(dirname "$0")
+fi
+
+# Uncomment this line if you never use gclient.
+# "$base_dir"/update_depot_tools
+
+if [ -e "$base_dir/python.bat" -a $MINGW = 0 ]; then
+ PYTHONDONTWRITEBYTECODE=1 cmd.exe //c "$base_dir\\python.bat" "$base_dir\\git_cache.py" "$@"
+else
+ PYTHONDONTWRITEBYTECODE=1 exec "$base_dir/git_cache.py" "$@"
+fi