libfetchers/git: fix for nixos-rebuild
libfetchers/git: fix for nixos-rebuild

The `--git-dir=` must be `.` in some cases (for cached repos that are
"bare" repos in `~/.cache/nix/gitv3`). With this fix we can add
`--git-dir` to each `git`-invokation needed for `nixos-rebuild`.

NixOS/nix,NixOS/nix,NixOS/nix,NixOS/nix,NixOS/nix