git-serve: Refactor environment variable access