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:
parent
ebf78d4683
commit
776e80008d
|
@ -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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue