Skip to content

Commit 31d87dc

Browse files
sergeibbbd13
authored andcommitted
Add parent commit timestamp tracking to GitStashCommit model
(#4401, #4468)
1 parent ad2bc55 commit 31d87dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/git/models/commit.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export class GitCommit implements GitRevisionReference {
6666
readonly stashNumber: string | undefined;
6767
readonly stashOnRef: string | undefined;
6868
readonly tips: string[] | undefined;
69+
readonly parentTimestamps?: GitStashParentInfo[] | undefined;
6970

7071
constructor(
7172
private readonly container: Container,
@@ -82,10 +83,12 @@ export class GitCommit implements GitRevisionReference {
8283
tips?: string[],
8384
stashName?: string | undefined,
8485
stashOnRef?: string | undefined,
86+
parentTimestamps?: GitStashParentInfo[] | undefined,
8587
) {
8688
this.ref = sha;
8789
this.shortSha = sha.substring(0, this.container.CommitShaFormatting.length);
8890
this.tips = tips;
91+
this.parentTimestamps = parentTimestamps;
8992

9093
if (stashName) {
9194
this.refType = 'stash';
@@ -689,6 +692,7 @@ export class GitCommit implements GitRevisionReference {
689692
fileset?: GitCommitFileset | null;
690693
lines?: GitCommitLine[] | null;
691694
stats?: GitCommitStats | null;
695+
parentTimestamps?: GitStashParentInfo[] | null;
692696
}): T {
693697
return new GitCommit(
694698
this.container,
@@ -705,6 +709,7 @@ export class GitCommit implements GitRevisionReference {
705709
this.tips,
706710
this.stashName,
707711
this.stashOnRef,
712+
this.getChangedValue(changes.parentTimestamps, this.parentTimestamps),
708713
) as T;
709714
}
710715

@@ -763,10 +768,17 @@ export interface GitCommitStats<Files extends number | GitDiffFileStats = number
763768
readonly deletions: number;
764769
}
765770

771+
export interface GitStashParentInfo {
772+
readonly sha: string;
773+
readonly authorDate?: number;
774+
readonly committerDate?: number;
775+
}
776+
766777
export interface GitStashCommit extends GitCommit {
767778
readonly refType: GitStashReference['refType'];
768779
readonly stashName: string;
769780
readonly stashNumber: string;
781+
readonly parentTimestamps?: GitStashParentInfo[];
770782
}
771783

772784
export type GitCommitWithFullDetails = GitCommit & SomeNonNullable<GitCommit, 'message' | 'fileset'>;

0 commit comments

Comments
 (0)