Clean up local variable usage - git functions

Cleans up the git-related functions in functions-common

Change-Id: I5f1851c0473e92c61b1e8af60e7ef32c3019f719
Merge "Clean up local variable usage - git functions"