parameters: ()
docstring: Installs the git pre-push hooks.
docstring_summary: Installs the git pre-push hooks.
docstring_tokens: Installs the git pre - push hooks .
function: def InstallHooks():
    """Installs the git pre-push hooks."""
    if sys.platform == 'win32':
      return
  
    # Remove old pre-commit, see https://github.com/google/trace-viewer/issues/932
    old_precommit = os.path.join(_TOP_PATH, '.git', 'hooks', 'pre-commit')
    old_precommit_target = os.path.join(_TOP_PATH, 'hooks', 'pre_commit')
    if (os.path.islink(old_precommit) and
        os.path.abspath(os.readlink(old_precommit)) == old_precommit_target):
      os.remove(old_precommit)
  
    # The pre-push hook prevents forced pushes; see ./pre_push.
    links = [
        Link(os.path.join('.git', 'hooks', 'pre-push'),
             os.path.join('hooks', 'pre_push'))
    ]
  
    for l in links:
      l.Update()
function_tokens: def InstallHooks ( ) : if sys . platform == 'win32' : return # Remove old pre-commit, see https://github.com/google/trace-viewer/issues/932 old_precommit = os . path . join ( _TOP_PATH , '.git' , 'hooks' , 'pre-commit' ) old_precommit_target = os . path . join ( _TOP_PATH , 'hooks' , 'pre_commit' ) if ( os . path . islink ( old_precommit ) and os . path . abspath ( os . readlink ( old_precommit ) ) == old_precommit_target ) : os . remove ( old_precommit ) # The pre-push hook prevents forced pushes; see ./pre_push. links = [ Link ( os . path . join ( '.git' , 'hooks' , 'pre-push' ) , os . path . join ( 'hooks' , 'pre_push' ) ) ] for l in links : l . Update ( )