Skip to content

Commit e6424ef

Browse files
author
Asim Aslam
authored
Merge pull request #7 from dokku/respect-daemon-env
fix: respect the env in which the daemon is executed
2 parents 8b4d2dc + 4efb83b commit e6424ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-http-backend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func serviceRpc(hr HandlerReq) {
131131
w.Header().Set("X-Content-Type-Options", "nosniff")
132132
w.WriteHeader(http.StatusOK)
133133

134-
env := []string{}
134+
env := os.Environ()
135135

136136
if config.DefaultEnv != "" {
137137
env = append(env, config.DefaultEnv)
@@ -151,7 +151,7 @@ func serviceRpc(hr HandlerReq) {
151151
cmd := exec.Command(config.GitBinPath, args...)
152152
version := r.Header.Get("Git-Protocol")
153153
if len(version) != 0 {
154-
cmd.Env = append(os.Environ(), fmt.Sprintf("GIT_PROTOCOL=%s", version))
154+
cmd.Env = append(env, fmt.Sprintf("GIT_PROTOCOL=%s", version))
155155
}
156156
cmd.Dir = dir
157157
cmd.Env = env

0 commit comments

Comments
 (0)