Commit 71cbb503 authored by szager@chromium.org's avatar szager@chromium.org

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
parent 28de290f
......@@ -16,6 +16,9 @@ import scm
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 @@ class GitWrapper(SCMWrapper):
# 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment