greatly simplified the return of $git_repo array and other fixes as suggested by @GaryJones