From cfedc852d4e20ebf66a3d6b0e5e7cc477a52ab94 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 30 Jan 2023 13:17:26 -0500 Subject: [PATCH] Fixes #2473 last fetched date is wrong --- CHANGELOG.md | 4 ++++ src/env/node/git/localGitProvider.ts | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9400c69..57b16fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Adds a new experimental minimap of commit activity to the _Commit Graph_ +### Fixed + +- Fixes [#2473](https://github.com/gitkraken/vscode-gitlens/issues/2473) - Commit graph status bar show wrong last fetched date + ## [13.2.0] - 2022-12-20 ### Added diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 64f7340..ccad269 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -2524,9 +2524,7 @@ export class LocalGitProvider implements GitProvider, Disposable { async getLastFetchedTimestamp(repoPath: string): Promise { try { const gitDir = await this.getGitDir(repoPath); - const stats = await workspace.fs.stat( - this.container.git.getAbsoluteUri(Uri.joinPath(gitDir.commonUri ?? gitDir.uri, 'FETCH_HEAD'), repoPath), - ); + const stats = await workspace.fs.stat(Uri.joinPath(gitDir.uri, 'FETCH_HEAD')); // If the file is empty, assume the fetch failed, and don't update the timestamp if (stats.size > 0) return stats.mtime; } catch {}