From 8821e8ddf6190660fe174898bcbab79e6ced7d5a357c0d0b2a8cc297de1de81e Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Mon, 15 Jul 2024 21:20:33 +0200 Subject: [PATCH] . --- bots-common/git_utils.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bots-common/git_utils.go b/bots-common/git_utils.go index a8dced2..0079053 100644 --- a/bots-common/git_utils.go +++ b/bots-common/git_utils.go @@ -476,9 +476,21 @@ func (e *RequestHandler) GitSubmoduleCommitId(cwd, packageName, commitId string) }() cmd := exec.Command("/usr/bin/git", "cat-file", "--batch", "-Z") + cmd.Env = []string{ + "GIT_CEILING_DIRECTORIES=" + e.GitPath, + "GIT_CONFIG_GLOBAL=/dev/null", + "GIT_AUTHOR_NAME=" + e.GitCommiter, + "EMAIL=not@exist@src.opensuse.org", + "GIT_LFS_SKIP_SMUDGE=1", + "GIT_SSH_COMMAND=/usr/bin/ssh -o StrictHostKeyChecking=yes", + } cmd.Dir = filepath.Join(e.GitPath, cwd) cmd.Stdout = &data_in cmd.Stdin = &data_out + cmd.Stderr = writeFunc(func(data []byte) (int, error) { + e.Logger.LogError("%s", data) + return len(data), nil + }) e.Log("command run: %v", cmd.Run()) foundLock.Lock()