scons: Rewrite git style hook installer
scons: Rewrite git style hook installer

The SCons script currently assumes that .git is a proper directory
with all git meta data. This isn't the case if the working directory
was checked out using git worktrees. In such case .git is a file with
meta data telling git where the repository data is stored.

This changeset updates changes the SConstruct file to rely on git
rev-parse to get the real git directory.

Change-Id: I3d0475eabc12e868193797067a88e540a9b6e927
Signed-off-by: Andreas Sandberg <c9f5686ee5bd561c93f9de79681eee75bfa7f36e@arm.com>
Reviewed-by: Curtis Dunham <14490907fdc9c150c92157b82121c81003bbdc71@arm.com>

TUD-OS/gem5-dtu,rallylee/gem5,HwisooSo/gemV-update,KuroeKurose/gem5,gem5/gem5,Weil0ng/gem5,qizenguf/MLC-STT,Weil0ng/gem5,qizenguf/MLC-STT,sobercoder/gem5,qizenguf/MLC-STT,powerjg/gem5-ci-test,TUD-OS/gem5-dtu,cancro7/gem5,HwisooSo/gemV-update,powerjg/gem5-ci-test,TUD-OS/gem5-dtu,gem5/gem5,powerjg/gem5-ci-test,gedare/gem5,gem5/gem5,rjschof/gem5,gedare/gem5,gedare/gem5,rjschof/gem5,rallylee/gem5,rallylee/gem5,gedare/gem5,gedare/gem5,cancro7/gem5,rjschof/gem5,powerjg/gem5-ci-test,cancro7/gem5,briancoutinho0905/2dsampling,cancro7/gem5,SanchayanMaity/gem5,SanchayanMaity/gem5,Weil0ng/gem5,aclifton/cpeg853-gem5,rjschof/gem5,KuroeKurose/gem5,KuroeKurose/gem5,aclifton/cpeg853-gem5,SanchayanMaity/gem5,Weil0ng/gem5,gedare/gem5,KuroeKurose/gem5,sobercoder/gem5,qizenguf/MLC-STT,TUD-OS/gem5-dtu,gem5/gem5,powerjg/gem5-ci-test,gedare/gem5,HwisooSo/gemV-update,cancro7/gem5,briancoutinho0905/2dsampling,HwisooSo/gemV-update,rallylee/gem5,SanchayanMaity/gem5,aclifton/cpeg853-gem5,briancoutinho0905/2dsampling,rjschof/gem5,cancro7/gem5,Weil0ng/gem5,KuroeKurose/gem5,sobercoder/gem5,rjschof/gem5,SanchayanMaity/gem5,aclifton/cpeg853-gem5,HwisooSo/gemV-update,KuroeKurose/gem5,rjschof/gem5,briancoutinho0905/2dsampling,TUD-OS/gem5-dtu,rallylee/gem5,aclifton/cpeg853-gem5,KuroeKurose/gem5,powerjg/gem5-ci-test,aclifton/cpeg853-gem5,briancoutinho0905/2dsampling,qizenguf/MLC-STT,qizenguf/MLC-STT,TUD-OS/gem5-dtu,gem5/gem5,SanchayanMaity/gem5,SanchayanMaity/gem5,Weil0ng/gem5,HwisooSo/gemV-update,gem5/gem5,qizenguf/MLC-STT,sobercoder/gem5,rallylee/gem5,TUD-OS/gem5-dtu,cancro7/gem5,Weil0ng/gem5,rallylee/gem5,briancoutinho0905/2dsampling,briancoutinho0905/2dsampling,HwisooSo/gemV-update,powerjg/gem5-ci-test,sobercoder/gem5,aclifton/cpeg853-gem5,sobercoder/gem5,gem5/gem5,sobercoder/gem5