tg.sh: completely ignore hooksPath until setup_hook
commit6d06aacea1463805d482e3734695fe384d737c77
authorKyle J. McKay <mackyle@gmail.com>
Thu, 4 Jan 2018 04:16:39 +0000 (3 20:16 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 4 Jan 2018 04:16:39 +0000 (3 20:16 -0800)
tree00bd21d8adea80ba5a5d803f44068cb80a829836
parent0496e05eb4f85b9f80f25d59e440ff4b089c5731
tg.sh: completely ignore hooksPath until setup_hook

The current state of core.hooksPath is completely irrelevant (and
should be left totally unmolested) unless setup_hook gets called.

Therefore delay all inspection and setup of git_hooks_dir until
such time as setup_hook actually gets executed.  This means that
"read-only" tg commands that have no need to touch the repository
will never need to bother with the state of core.hooksPath at all.

Validate this with additional tests.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/t1062-hookspath.sh
tg.sh