瀏覽代碼

Adds a with method to commit

main
Eric Amodio 7 年之前
父節點
當前提交
1cdd94cb46
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. +8
    -0
      src/git/models/commit.ts

+ 8
- 0
src/git/models/commit.ts 查看文件

@ -76,4 +76,12 @@ export class GitCommit {
getFormattedPath(separator: string = Strings.pad(GlyphChars.Dot, 2, 2)): string {
return GitUri.getFormattedPath(this.fileName, separator);
}
with(changes: { type?: GitCommitType, fileName?: string, sha?: string, originalFileName?: string, previousFileName?: string, previousSha?: string }) {
return new GitCommit(changes.type || this.type, this.repoPath,
changes.sha || this.sha, changes.fileName || this.fileName,
this.author, this.date, this.message,
changes.originalFileName || this.originalFileName,
changes.previousSha || this.previousSha, changes.previousFileName || this.previousFileName);
}
}

Loading…
取消
儲存