Add placeholder git hooks.
This is a bit of future-proofing. The git hooks in depot_tools/git-templates/hooks all try to forward to build/git-hooks.
Currently, the only actual hook we have is in src/build/git-hooks/pre-commit, which (usefully) makes sure no one inadvertently commits a submodule change. If we want to add more git hooks, we can simply commit them to build/git-hooks, rather than asking everyone to modify .git/hooks in their checkout.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/14230012
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195336 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 3762f77..71fecd0 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -16,6 +16,9 @@
import subprocess2
+THIS_FILE_PATH = os.path.abspath(__file__)
+
+
class DiffFiltererWrapper(object):
"""Simple base class which tracks which file is being diffed and
replaces instances of its file name in the original and
@@ -653,8 +656,9 @@
# git clone doesn't seem to insert a newline properly before printing
# to stdout
print('')
-
- clone_cmd = ['clone', '--progress']
+ template_path = os.path.join(
+ os.path.dirname(THIS_FILE_PATH), 'git-templates')
+ clone_cmd = ['clone', '--progress', '--template=%s' % template_path]
if revision.startswith('refs/heads/'):
clone_cmd.extend(['-b', revision.replace('refs/heads/', '')])
detach_head = False