gitlabhq/gitlabhq — pull request #3862 by crazyscience (2013-05-07 02:13:13+00:00)
Title: Setting the working directory before git operations

Set the initial working directory. An issue can arise if the user is logged in as root and the current working directory is /root/. The console will return an error:

fatal: Could not change back to '/root': Permission denied

Changing the working directory prior to the clone operation seems to fix this.