Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit d7400d0

Browse files
author
Michelle Tilley
authored
Merge pull request #925 from atom/mkt-respect-author-committer-env
Respect GIT_AUTHOR_*/GIT_COMMITTER_* environment variables
2 parents 217668f + 572637b commit d7400d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/git-shell-out-strategy.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ import WorkerManager from './worker-manager';
2020
const LINE_ENDING_REGEX = /\r?\n/;
2121

2222
const GPG_HELPER_PATH = path.resolve(getPackageRoot(), 'bin', 'gpg-no-tty.sh');
23+
const ENV_VARS_TO_COPY = [
24+
'GIT_AUTHOR_NAME', 'GIT_AUTHOR_EMAIL', 'GIT_AUTHOR_DATE',
25+
'GIT_COMMITTER_NAME', 'GIT_COMMITTER_EMAIL', 'GIT_COMMITTER_DATE',
26+
'EMAIL', // fallback
27+
];
2328

2429
let headless = null;
2530

@@ -80,6 +85,12 @@ export default class GitShellOutStrategy {
8085
PATH: process.env.PATH || '',
8186
};
8287

88+
ENV_VARS_TO_COPY.forEach(envVar => {
89+
if (process.env[envVar] !== undefined) {
90+
env[envVar] = process.env[envVar];
91+
}
92+
});
93+
8394
if (useGitPromptServer) {
8495
gitPromptServer = new GitPromptServer();
8596
const {

0 commit comments

Comments
 (0)