Simplify repo helper in GitSpecHelpers

Condense two separate calls to `Dir.chdir(path)` into a single call with
a block passed in.

Change-Id: I41b089981414d4f02757740e411f336d5e18102a
Reviewed-on: https://gerrit.causes.com/25222
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>