I don't believe this is the case.
[1] pry(main)> system "echo", "$(whoami)"
$(whoami)
=> true
[2] pry(main)> system "git", "ls-remote", "--upload-pack=$(whoami)", "HEAD"
$(whoami) 'HEAD': USERNAME: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
=> false