(env []string, scratch, world string)
| 314 | } |
| 315 | |
| 316 | func gitEnvironment(env []string, scratch, world string) ([]string, error) { |
| 317 | exe, err := os.Executable() |
| 318 | if err != nil { |
| 319 | return nil, err |
| 320 | } |
| 321 | world, err = filepath.Abs(world) |
| 322 | if err != nil { |
| 323 | return nil, err |
| 324 | } |
| 325 | // Relocated Git distributions use this to find their transport helpers. |
| 326 | // It selects the installed tooling, not the caller's Git configuration. |
| 327 | if execPath := os.Getenv("GIT_EXEC_PATH"); execPath != "" { |
| 328 | env = append(env, "GIT_EXEC_PATH="+execPath) |
| 329 | } |
| 330 | return append(env, |
| 331 | "LC_ALL=C", |
| 332 | "GIT_AUTHOR_NAME=monalisa", "GIT_AUTHOR_EMAIL=monalisa@example.invalid", |
| 333 | "GIT_COMMITTER_NAME=monalisa", "GIT_COMMITTER_EMAIL=monalisa@example.invalid", |
| 334 | "GIT_AUTHOR_DATE=2000-01-01T00:00:00Z", "GIT_COMMITTER_DATE=2000-01-01T00:00:00Z", |
| 335 | "GIT_TEMPLATE_DIR="+filepath.Join(scratch, "templates"), |
| 336 | "GIT_SSH_COMMAND="+shellQuote(exe)+" _git-ssh", "GIT_SSH_VARIANT=ssh", |
| 337 | "GHMOCK_GIT_WORLD="+world, "GHMOCK_GIT_LOG="+filepath.Join(scratch, "git-ssh.jsonl"), |
| 338 | ), nil |
| 339 | } |
| 340 | |
| 341 | func gitDeadlineEnvironment(ctx context.Context, env []string) []string { |
| 342 | if deadline, ok := ctx.Deadline(); ok { |
no test coverage detected