From dab25a37f02979c94cabae32fd73e6ff3877ce75 Mon Sep 17 00:00:00 2001 From: Eric Amodio <eamodio@gmail.com> Date: Sun, 28 Feb 2021 23:20:43 -0500 Subject: [PATCH] Adds reset avatar cache command --- CHANGELOG.md | 1 + package.json | 10 ++++++++++ src/commands.ts | 1 + src/commands/common.ts | 1 + src/commands/resetAvatarCache.ts | 14 ++++++++++++++ 5 files changed, 27 insertions(+) create mode 100644 src/commands/resetAvatarCache.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 812ec71..a28b2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - _Toggles the file changes from the commit_ - Adds _Publish Repository_ command (`gitlens.publishRepository`) to publish the repository to a remote provider - Adds supported remote types in README — thanks to [PR #1371](https://github.com/eamodio/vscode-gitlens/pull/1371) by Vladislav Guleaev ([@vguleaev](https://github.com/vguleaev)) +- Adds a new _Reset Avatar Cache_ command (`gitlens.resetAvatarCache`) to clear the avatar cache ### Changed diff --git a/package.json b/package.json index b0571d1..1262457 100644 --- a/package.json +++ b/package.json @@ -179,6 +179,7 @@ "onCommand:gitlens.stashSaveFiles", "onCommand:gitlens.externalDiff", "onCommand:gitlens.externalDiffAll", + "onCommand:gitlens.resetAvatarCache", "onCommand:gitlens.resetSuppressedWarnings", "onCommand:gitlens.inviteToLiveShare", "onCommand:gitlens.browseRepoAtRevision", @@ -3748,6 +3749,11 @@ "category": "GitLens" }, { + "command": "gitlens.resetAvatarCache", + "title": "Reset Avatar Cache", + "category": "GitLens" + }, + { "command": "gitlens.resetSuppressedWarnings", "title": "Reset Suppressed Warnings", "category": "GitLens" @@ -5471,6 +5477,10 @@ "when": "false" }, { + "command": "gitlens.resetAvatarCache", + "when": "gitlens:enabled" + }, + { "command": "gitlens.resetSuppressedWarnings", "when": "gitlens:enabled" }, diff --git a/src/commands.ts b/src/commands.ts index 5136751..6df66a7 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -40,6 +40,7 @@ export * from './commands/rebaseEditor'; export * from './commands/refreshHover'; export * from './commands/remoteProviders'; export * from './commands/repositories'; +export * from './commands/resetAvatarCache'; export * from './commands/resetSuppressedWarnings'; export * from './commands/setViewsLayout'; export * from './commands/searchCommits'; diff --git a/src/commands/common.ts b/src/commands/common.ts index 0fbcc5c..19e95bb 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -101,6 +101,7 @@ export enum Commands { GitCommands = 'gitlens.gitCommands', QuickOpenFileHistory = 'gitlens.quickOpenFileHistory', RefreshHover = 'gitlens.refreshHover', + ResetAvatarCache = 'gitlens.resetAvatarCache', ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings', RevealCommitInView = 'gitlens.revealCommitInView', SearchCommits = 'gitlens.showCommitSearch', diff --git a/src/commands/resetAvatarCache.ts b/src/commands/resetAvatarCache.ts new file mode 100644 index 0000000..de1be3f --- /dev/null +++ b/src/commands/resetAvatarCache.ts @@ -0,0 +1,14 @@ +'use strict'; +import { resetAvatarCache } from '../avatars'; +import { command, Command, Commands } from './common'; + +@command() +export class ResetAvatarCacheCommand extends Command { + constructor() { + super(Commands.ResetAvatarCache); + } + + execute() { + resetAvatarCache('all'); + } +}