From b498c2a046a8966b83506c24056eff37fadfecfd Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 23 Feb 2022 13:12:37 -0500 Subject: [PATCH] Ensures getting the files details updates the file --- src/git/models/commit.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index 26ccd1e..94f39bb 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -202,6 +202,20 @@ export class GitCommit implements GitRevisionReference { this._message = commit.message; this._files = commit.files as GitFileChange[]; + if (this._file != null) { + const file = this._files.find(f => f.path === this._file!.path); + if (file != null) { + this._file = new GitFileChange( + file.repoPath, + file.path, + file.status, + file.originalPath ?? this._file.originalPath, + file.previousSha ?? this._file.previousSha, + file.stats ?? this._file.stats, + ); + } + } + if (untrackedResult.status === 'fulfilled' && untrackedResult.value != null) { this._stashUntrackedFilesLoaded = true; commit = untrackedResult.value;