only record one of two
This commit is contained in:
parent
ff5509f1a7
commit
e25d26bcab
|
|
@ -89,14 +89,6 @@ async function gitStatusFromCLI(gitDir: string, envInfo: Pick<GitCommitInfo, 'pu
|
||||||
'revision.timestamp': timestamp,
|
'revision.timestamp': timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
const diffResult = await spawnAsync(
|
|
||||||
'git',
|
|
||||||
['diff', 'HEAD~1'],
|
|
||||||
{ stdio: 'pipe', cwd: gitDir, timeout: GIT_OPERATIONS_TIMEOUT_MS }
|
|
||||||
);
|
|
||||||
if (!diffResult.code)
|
|
||||||
result['revision.diff'] = diffResult.stdout;
|
|
||||||
|
|
||||||
if (envInfo['pull.base']) {
|
if (envInfo['pull.base']) {
|
||||||
const pullDiffResult = await spawnAsync(
|
const pullDiffResult = await spawnAsync(
|
||||||
'git',
|
'git',
|
||||||
|
|
@ -105,6 +97,14 @@ async function gitStatusFromCLI(gitDir: string, envInfo: Pick<GitCommitInfo, 'pu
|
||||||
);
|
);
|
||||||
if (!pullDiffResult.code)
|
if (!pullDiffResult.code)
|
||||||
result['pull.diff'] = pullDiffResult.stdout;
|
result['pull.diff'] = pullDiffResult.stdout;
|
||||||
|
} else {
|
||||||
|
const diffResult = await spawnAsync(
|
||||||
|
'git',
|
||||||
|
['diff', 'HEAD~1'],
|
||||||
|
{ stdio: 'pipe', cwd: gitDir, timeout: GIT_OPERATIONS_TIMEOUT_MS }
|
||||||
|
);
|
||||||
|
if (!diffResult.code)
|
||||||
|
result['revision.diff'] = diffResult.stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue