Fixed hook installation for git with submodules.

See
https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.8.txt.
The .git dir in the submodule dir is just a file pointing to a subdir of
the parent module's .git dir. Affects git >= 1.7.8.

Change-Id: I758972bc70e98cf904197bc189cadffd7b23540f
This commit is contained in:
Aaron Schulz 2012-05-05 15:19:30 -07:00
parent ebf78d4683
commit 776e80008d
1 changed files with 2 additions and 2 deletions

View File

@ -111,8 +111,8 @@ def latest_is_newer():
def get_hooks_target_file():
top_dir = run_command('git rev-parse --show-toplevel')
hooks_dir = os.path.join(top_dir, ".git/hooks")
top_dir = run_command('git rev-parse --git-dir')
hooks_dir = os.path.join(top_dir, "hooks")
return os.path.join(hooks_dir, "commit-msg")