Skip to content

Commit 9e087f6

Browse files
committed
Pass $HOME to git as well
[ this patch has the same rationale and reasoning as https://gitlab.com/gitlab-org/gitlab-workhorse/commit/0d0bd209 details follow ] Git has 3 places for configs: - system - global (per user), and - local (per repository) System config location is hardcoded at git compile time (to usually $prefix/etc/gitconfig). Local configuration is usually picked because we pass full repo path to subcommand. But global configuration is currently not picked at all, because HOME env variable is not passed to git. Pass $HOME through and let git see it's "global" config. Currently GitLab omnibus stores gitlab user name/email + "autocrlf = true" in global config, so missing it should not be a blocker for receive/send-pack operations. But having it is more correct and can be handy in the future if/when more git operations are done from-under gitlab-shell. Having $HOME properly set is also needed when one cannot change system git config and have to put site-wide configuration into global git config under $HOME. That was the case I've hit and the reason for this patch.
1 parent 827a11c commit 9e087f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/gitlab_shell.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def process_cmd
122122
# This method is not covered by Rspec because it ends the current Ruby process.
123123
def exec_cmd(*args)
124124
env = {
125+
'HOME' => ENV['HOME'],
125126
'PATH' => ENV['PATH'],
126127
'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'],
127128
'LANG' => ENV['LANG'],

0 commit comments

Comments
 (0)