Skip to content

Commit cc2daea

Browse files
committed
fix: 修复变量错误
1 parent 99fa349 commit cc2daea

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/apis/process/full.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { CommitInfo, FullResult } from '../../types';
55
import { getActualGitRepoRoot } from "../../utils";
66

77
export class FullProcess<T extends keyof Mapper> extends BaseProcess<T> {
8+
private firstGitMessage: CommitInfo = {};
9+
810
constructor(lcovPath: string | string[], opts: BaseProcessOpts<T> = { stream: {} }) {
911
super();
1012

@@ -31,7 +33,7 @@ export class FullProcess<T extends keyof Mapper> extends BaseProcess<T> {
3133
createInfo = await this.getCreateInfo();
3234

3335
if (createInfo) {
34-
this.firstInfo = createInfo as CommitInfo;
36+
this.firstGitMessage = createInfo as CommitInfo;
3537
}
3638
}
3739

src/apis/process/increase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class IncreaseProcess<T extends keyof Mapper> extends BaseProcess<T> {
6060
const createInfo = await this.getCreateInfo() as CommitInfo;
6161

6262
// 得到创建信息
63-
this.firstInfo = createInfo;
63+
this.firstGitMessage = createInfo;
6464

6565
// 得到增量合并结果
6666
await this.getLcov();
@@ -92,7 +92,7 @@ export class IncreaseProcess<T extends keyof Mapper> extends BaseProcess<T> {
9292
this.lcov = (
9393
await new IncreaseConcat({
9494
cwd: this.opts.cwd,
95-
hash: this.firstGitMessage.hash,
95+
hash: this.firstGitMessage?.hash,
9696
}).concat(...res)
9797
).getRes();
9898
}

src/apis/process/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export abstract class BaseProcess<T extends keyof Mapper> {
3636
files: [],
3737
};
3838

39-
protected firstInfo: CommitInfo | undefined;
40-
4139
abstract async exec(): Promise<FullResult>;
4240

4341
/**

0 commit comments

Comments
 (0)