shell setup: clear_local_git_env() function
Introduce an auxiliary function to clear all repo-local environment
variables. This should be invoked by any shell script that switches
repository during execution, to ensure that the environment is clean
and that things such as the git dir and worktree are set up correctly.
The list matches the one in git_connect(), so bring them in sync by adding
the missing CONFIG_ENVIRONMENT. Also add a note about the fact that they
should be kept that way.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>