This feels really pointless. If I can create /.git, I have root already. Any other parent-directory-escalation that I can think of would be so obscure as to be not worth caring about, and would also probably require having access to an already-higher-privilege account.
And of course the unspoken: almost nobody uses git on multi user systems, and when they do, most of the time every single user already has sudo.