From 82e475be8a02c36971a39929839ae76909f0b497 Mon Sep 17 00:00:00 2001 From: Michael Hutchison Date: Tue, 8 Dec 2020 19:02:11 +1100 Subject: [PATCH] #429 New extension and repository settings to control whether stashes are shown in the Git Graph View. --- package.json | 5 ++++ src/config.ts | 7 ++++++ src/dataSource.ts | 5 ++-- src/extensionState.ts | 1 + src/gitGraphView.ts | 3 ++- src/repoManager.ts | 10 ++++++++ src/types.ts | 3 +++ tests/config.test.ts | 2 ++ tests/dataSource.test.ts | 48 +++++++++++++++++++++++++++--------- tests/extensionState.test.ts | 8 ++++++ tests/repoManager.test.ts | 43 +++++++++++++++++++++----------- web/main.ts | 7 ++++++ web/settingsWidget.ts | 11 +++++++++ 13 files changed, 124 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 88ca7da6..00f1bd93 100644 --- a/package.json +++ b/package.json @@ -986,6 +986,11 @@ "default": true, "description": "Show Remote HEAD Symbolic References in Git Graph (e.g. \"origin/HEAD\")." }, + "git-graph.repository.showStashes": { + "type": "boolean", + "default": true, + "description": "Show Stashes in Git Graph by default. This can be overridden per repository in the Git Graph View's Repository Settings Widget." + }, "git-graph.repository.showTags": { "type": "boolean", "default": true, diff --git a/src/config.ts b/src/config.ts index 29020dc2..8890888c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -462,6 +462,13 @@ class Config { return !!this.config.get('repository.showRemoteHeads', true); } + /** + * Get the value of the `git-graph.repository.showStashes` Extension Setting. + */ + get showStashes() { + return !!this.config.get('repository.showStashes', true); + } + /** * Get the value of the `git-graph.repository.showTags` Extension Setting. */ diff --git a/src/dataSource.ts b/src/dataSource.ts index a709b27f..6b18c379 100644 --- a/src/dataSource.ts +++ b/src/dataSource.ts @@ -124,14 +124,15 @@ export class DataSource extends Disposable { * Get the high-level information of a repository. * @param repo The path of the repository. * @param showRemoteBranches Are remote branches shown. + * @param showStashes Are stashes shown. * @param hideRemotes An array of hidden remotes. * @returns The repositories information. */ - public getRepoInfo(repo: string, showRemoteBranches: boolean, hideRemotes: ReadonlyArray): Promise { + public getRepoInfo(repo: string, showRemoteBranches: boolean, showStashes: boolean, hideRemotes: ReadonlyArray): Promise { return Promise.all([ this.getBranches(repo, showRemoteBranches, hideRemotes), this.getRemotes(repo), - this.getStashes(repo) + showStashes ? this.getStashes(repo) : Promise.resolve([]) ]).then((results) => { return { branches: results[0].branches, head: results[0].head, remotes: results[1], stashes: results[2], error: null }; }).catch((errorMessage) => { diff --git a/src/extensionState.ts b/src/extensionState.ts index f8c9223f..3ccfaf2b 100644 --- a/src/extensionState.ts +++ b/src/extensionState.ts @@ -34,6 +34,7 @@ export const DEFAULT_REPO_STATE: GitRepoState = { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default }; diff --git a/src/gitGraphView.ts b/src/gitGraphView.ts index fdcb0274..9caf2a5a 100644 --- a/src/gitGraphView.ts +++ b/src/gitGraphView.ts @@ -422,7 +422,7 @@ export class GitGraphView extends Disposable { break; case 'loadRepoInfo': this.loadRepoInfoRefreshId = msg.refreshId; - let repoInfo = await this.dataSource.getRepoInfo(msg.repo, msg.showRemoteBranches, msg.hideRemotes), isRepo = true; + let repoInfo = await this.dataSource.getRepoInfo(msg.repo, msg.showRemoteBranches, msg.showStashes, msg.hideRemotes), isRepo = true; if (repoInfo.error) { // If an error occurred, check to make sure the repo still exists isRepo = (await this.dataSource.repoRoot(msg.repo)) !== null; @@ -647,6 +647,7 @@ export class GitGraphView extends Disposable { referenceLabels: config.referenceLabels, repoDropdownOrder: config.repoDropdownOrder, showRemoteBranches: config.showRemoteBranches, + showStashes: config.showStashes, showTags: config.showTags }, lastActiveRepo: this.extensionState.getLastActiveRepo(), diff --git a/src/repoManager.ts b/src/repoManager.ts index 1259e2a4..1198db24 100644 --- a/src/repoManager.ts +++ b/src/repoManager.ts @@ -732,6 +732,7 @@ export namespace ExternalRepoConfig { onRepoLoadShowSpecificBranches?: string[]; pullRequestConfig?: PullRequestConfig; showRemoteBranches?: boolean; + showStashes?: boolean; showTags?: boolean; exportedAt?: number; } @@ -849,6 +850,9 @@ function generateExternalConfigFile(state: GitRepoState): Readonly) { if (typeof file.showRemoteBranches !== 'undefined' && typeof file.showRemoteBranches !== 'boolean') { return 'showRemoteBranches'; } + if (typeof file.showStashes !== 'undefined' && typeof file.showStashes !== 'boolean') { + return 'showStashes'; + } if (typeof file.showTags !== 'undefined' && typeof file.showTags !== 'boolean') { return 'showTags'; } @@ -1000,6 +1007,9 @@ function applyExternalConfigFile(file: Readonly, state: if (typeof file.showRemoteBranches !== 'undefined') { state.showRemoteBranchesV2 = file.showRemoteBranches ? BooleanOverride.Enabled : BooleanOverride.Disabled; } + if (typeof file.showStashes !== 'undefined') { + state.showStashes = file.showStashes ? BooleanOverride.Enabled : BooleanOverride.Disabled; + } if (typeof file.showTags !== 'undefined') { state.showTags = file.showTags ? BooleanOverride.Enabled : BooleanOverride.Disabled; } diff --git a/src/types.ts b/src/types.ts index 49913e4f..092873d5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -199,6 +199,7 @@ export interface GitRepoState { pullRequestConfig: PullRequestConfig | null; showRemoteBranches: boolean; showRemoteBranchesV2: BooleanOverride; + showStashes: BooleanOverride; showTags: BooleanOverride; } @@ -241,6 +242,7 @@ export interface GitGraphViewConfig { readonly referenceLabels: ReferenceLabelsConfig; readonly repoDropdownOrder: RepoDropdownOrder; readonly showRemoteBranches: boolean; + readonly showStashes: boolean; readonly showTags: boolean; } @@ -888,6 +890,7 @@ export interface RequestLoadRepoInfo extends RepoRequest { readonly command: 'loadRepoInfo'; readonly refreshId: number; readonly showRemoteBranches: boolean; + readonly showStashes: boolean; readonly hideRemotes: ReadonlyArray; } export interface ResponseLoadRepoInfo extends ResponseWithErrorInfo { diff --git a/tests/config.test.ts b/tests/config.test.ts index a209a7be..5c337331 100644 --- a/tests/config.test.ts +++ b/tests/config.test.ts @@ -2610,6 +2610,8 @@ describe('Config', () => { describe('showRemoteHeads', testBooleanExtensionSetting('showRemoteHeads', 'repository.showRemoteHeads', true)); + describe('showStashes', testBooleanExtensionSetting('showStashes', 'repository.showStashes', true)); + describe('showTags', testRenamedBooleanExtensionSetting('showTags', 'repository.showTags', 'showTags', true)); describe('showUncommittedChanges', testRenamedBooleanExtensionSetting('showUncommittedChanges', 'repository.showUncommittedChanges', 'showUncommittedChanges', true)); diff --git a/tests/dataSource.test.ts b/tests/dataSource.test.ts index 7e17022f..3e0a27fa 100644 --- a/tests/dataSource.test.ts +++ b/tests/dataSource.test.ts @@ -126,7 +126,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, []); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, []); // Assert expect(result).toStrictEqual({ @@ -162,7 +162,7 @@ describe('DataSource', () => { expect(spyOnSpawn).toBeCalledWith('/path/to/git', ['reflog', '--format=%HXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%PXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%gDXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%anXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%aeXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%atXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%s', 'refs/stash', '--'], expect.objectContaining({ cwd: '/path/to/repo' })); }); - it('Should return the repository info (when show remote branches is FALSE)', async () => { + it('Should return the repository info (when showRemoteBranches is FALSE)', async () => { // Setup mockGitSuccessOnce( '* develop\n' + @@ -173,7 +173,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', false, []); + const result = await dataSource.getRepoInfo('/path/to/repo', false, true, []); // Assert expect(result).toStrictEqual({ @@ -205,7 +205,7 @@ describe('DataSource', () => { onDidChangeConfiguration.emit({ affectsConfiguration: (section) => section === 'git-graph.date.type' }); - const result = await dataSource.getRepoInfo('/path/to/repo', false, []); + const result = await dataSource.getRepoInfo('/path/to/repo', false, true, []); // Assert expect(result).toStrictEqual({ @@ -237,7 +237,7 @@ describe('DataSource', () => { onDidChangeConfiguration.emit({ affectsConfiguration: (section) => section === 'git-graph.dateType' }); - const result = await dataSource.getRepoInfo('/path/to/repo', false, []); + const result = await dataSource.getRepoInfo('/path/to/repo', false, true, []); // Assert expect(result).toStrictEqual({ @@ -269,7 +269,7 @@ describe('DataSource', () => { onDidChangeConfiguration.emit({ affectsConfiguration: (section) => section === 'git-graph.repository.useMailmap' }); - const result = await dataSource.getRepoInfo('/path/to/repo', false, []); + const result = await dataSource.getRepoInfo('/path/to/repo', false, true, []); // Assert expect(result).toStrictEqual({ @@ -301,7 +301,7 @@ describe('DataSource', () => { onDidChangeConfiguration.emit({ affectsConfiguration: (section) => section === 'git-graph.useMailmap' }); - const result = await dataSource.getRepoInfo('/path/to/repo', false, []); + const result = await dataSource.getRepoInfo('/path/to/repo', false, true, []); // Assert expect(result).toStrictEqual({ @@ -316,6 +316,30 @@ describe('DataSource', () => { expect(spyOnSpawn).toBeCalledWith('/path/to/git', ['reflog', '--format=%HXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%PXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%gDXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%aNXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%aEXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%atXX7Nal-YARtTpjCikii9nJxER19D6diSyk-AWkPb%s', 'refs/stash', '--'], expect.objectContaining({ cwd: '/path/to/repo' })); }); + it('Should return the repository info (showStashes is FALSE)', async () => { + // Setup + mockGitSuccessOnce( + '* develop\n' + + ' master\n' + ); + mockGitSuccessOnce('origin\n'); + + // Run + const result = await dataSource.getRepoInfo('/path/to/repo', true, false, []); + + // Assert + expect(result).toStrictEqual({ + branches: ['develop', 'master'], + head: 'develop', + remotes: ['origin'], + stashes: [], + error: null + }); + expect(spyOnSpawn).toBeCalledWith('/path/to/git', ['branch', '-a', '--no-color'], expect.objectContaining({ cwd: '/path/to/repo' })); + expect(spyOnSpawn).toBeCalledWith('/path/to/git', ['remote'], expect.objectContaining({ cwd: '/path/to/repo' })); + expect(spyOnSpawn).toHaveBeenCalledTimes(2); + }); + it('Should return the repository info (hidden remote and an invalid branch)', async () => { // Setup mockGitSuccessOnce( @@ -330,7 +354,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, ['origin']); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, ['origin']); // Assert expect(result).toStrictEqual({ @@ -359,7 +383,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', false); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, []); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, []); // Assert expect(result).toStrictEqual({ @@ -382,7 +406,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, []); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, []); // Assert expect(result).toStrictEqual({ @@ -405,7 +429,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, []); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, []); // Assert expect(result).toStrictEqual({ @@ -428,7 +452,7 @@ describe('DataSource', () => { vscode.mockExtensionSettingReturnValue('repository.showRemoteHeads', true); // Run - const result = await dataSource.getRepoInfo('/path/to/repo', true, []); + const result = await dataSource.getRepoInfo('/path/to/repo', true, true, []); // Assert expect(result).toStrictEqual({ diff --git a/tests/extensionState.test.ts b/tests/extensionState.test.ts index dac27f80..d559351d 100644 --- a/tests/extensionState.test.ts +++ b/tests/extensionState.test.ts @@ -73,6 +73,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Enabled, + showStashes: BooleanOverride.Enabled, showTags: BooleanOverride.Enabled }; extensionContext.workspaceState.get.mockReturnValueOnce({ @@ -119,6 +120,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); @@ -155,6 +157,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); @@ -191,6 +194,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: false, showRemoteBranchesV2: BooleanOverride.Disabled, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); @@ -227,6 +231,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: false, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); @@ -263,6 +268,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Enabled, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); @@ -302,6 +308,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default }, '/path/to/repo-2': { @@ -321,6 +328,7 @@ describe('ExtensionState', () => { pullRequestConfig: null, showRemoteBranches: false, showRemoteBranchesV2: BooleanOverride.Disabled, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }); diff --git a/tests/repoManager.test.ts b/tests/repoManager.test.ts index 608d6de6..b16e64bb 100644 --- a/tests/repoManager.test.ts +++ b/tests/repoManager.test.ts @@ -925,6 +925,7 @@ describe('RepoManager', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default }; @@ -1681,6 +1682,7 @@ describe('RepoManager', () => { pullRequestConfig: null, showRemoteBranches: true, showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, showTags: BooleanOverride.Default } }; @@ -1767,6 +1769,11 @@ describe('RepoManager', () => { it('Should export BooleanOverride.Disabled correctly', testApplyField('showRemoteBranchesV2', BooleanOverride.Disabled, 'showRemoteBranches', false)); }); + describe('showStashes', () => { + it('Should export BooleanOverride.Enabled correctly', testApplyField('showStashes', BooleanOverride.Enabled, 'showStashes', true)); + it('Should export BooleanOverride.Disabled correctly', testApplyField('showStashes', BooleanOverride.Disabled, 'showStashes', false)); + }); + describe('showTags', () => { it('Should export BooleanOverride.Enabled correctly', testApplyField('showTags', BooleanOverride.Enabled, 'showTags', true)); it('Should export BooleanOverride.Disabled correctly', testApplyField('showTags', BooleanOverride.Disabled, 'showTags', false)); @@ -1827,6 +1834,7 @@ describe('RepoManager', () => { it('Should display a validation error when "pullRequestConfig" is invalid (no destProjectId)', testValidationOfField('pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.Bitbucket, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g' })); it('Should display a validation error when "pullRequestConfig" is invalid (no destBranch)', testValidationOfField('pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.Bitbucket, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h' })); it('Should display a validation error when "showRemoteBranches" is invalid', testValidationOfField('showRemoteBranches', 'invalid')); + it('Should display a validation error when "showStashes" is invalid', testValidationOfField('showStashes', 'invalid')); it('Should display a validation error when "showTags" is invalid', testValidationOfField('showTags', 'invalid')); }); @@ -2012,20 +2020,21 @@ describe('RepoManager', () => { cdvDivider: 0.5, cdvHeight: 250, columnWidths: null, - commitOrdering: 'default', - fileViewType: 0, + commitOrdering: RepoCommitOrdering.Default, + fileViewType: FileViewType.Default, hideRemotes: [], - includeCommitsMentionedByReflogs: 0, + includeCommitsMentionedByReflogs: BooleanOverride.Default, issueLinkingConfig: null, lastImportAt: 1587559258000, name: null, - onlyFollowFirstParent: 0, - onRepoLoadShowCheckedOutBranch: 0, + onlyFollowFirstParent: BooleanOverride.Default, + onRepoLoadShowCheckedOutBranch: BooleanOverride.Default, onRepoLoadShowSpecificBranches: null, pullRequestConfig: null, showRemoteBranches: true, - showRemoteBranchesV2: 0, - showTags: 0 + showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, + showTags: BooleanOverride.Default } }); @@ -2086,20 +2095,21 @@ describe('RepoManager', () => { cdvDivider: 0.5, cdvHeight: 250, columnWidths: null, - commitOrdering: 'default', - fileViewType: 0, + commitOrdering: RepoCommitOrdering.Default, + fileViewType: FileViewType.Default, hideRemotes: [], - includeCommitsMentionedByReflogs: 0, + includeCommitsMentionedByReflogs: BooleanOverride.Default, issueLinkingConfig: null, lastImportAt: 1587559258000, name: null, - onlyFollowFirstParent: 0, - onRepoLoadShowCheckedOutBranch: 0, + onlyFollowFirstParent: BooleanOverride.Default, + onRepoLoadShowCheckedOutBranch: BooleanOverride.Default, onRepoLoadShowSpecificBranches: null, pullRequestConfig: null, showRemoteBranches: true, - showRemoteBranchesV2: 0, - showTags: 0 + showRemoteBranchesV2: BooleanOverride.Default, + showStashes: BooleanOverride.Default, + showTags: BooleanOverride.Default } }); @@ -2238,6 +2248,11 @@ describe('RepoManager', () => { it('Should export BooleanOverride.Disabled correctly', testExportField('showRemoteBranchesV2', BooleanOverride.Disabled, 'showRemoteBranches', false)); }); + describe('showStashes', () => { + it('Should export BooleanOverride.Enabled correctly', testExportField('showStashes', BooleanOverride.Enabled, 'showStashes', true)); + it('Should export BooleanOverride.Disabled correctly', testExportField('showStashes', BooleanOverride.Disabled, 'showStashes', false)); + }); + describe('showTags', () => { it('Should export BooleanOverride.Enabled correctly', testExportField('showTags', BooleanOverride.Enabled, 'showTags', true)); it('Should export BooleanOverride.Disabled correctly', testExportField('showTags', BooleanOverride.Disabled, 'showTags', false)); diff --git a/web/main.ts b/web/main.ts index 1ddcb1c2..91cdfa6b 100644 --- a/web/main.ts +++ b/web/main.ts @@ -565,6 +565,7 @@ class GitGraphView { repo: this.currentRepo, refreshId: ++this.currentRepoRefreshState.loadRepoInfoRefreshId, showRemoteBranches: getShowRemoteBranches(repoState.showRemoteBranchesV2), + showStashes: getShowStashes(repoState.showStashes), hideRemotes: repoState.hideRemotes }); } @@ -3390,6 +3391,12 @@ function getShowRemoteBranches(repoValue: GG.BooleanOverride) { : repoValue === GG.BooleanOverride.Enabled; } +function getShowStashes(repoValue: GG.BooleanOverride) { + return repoValue === GG.BooleanOverride.Default + ? initialState.config.showStashes + : repoValue === GG.BooleanOverride.Enabled; +} + function getShowTags(repoValue: GG.BooleanOverride) { return repoValue === GG.BooleanOverride.Default ? initialState.config.showTags diff --git a/web/settingsWidget.ts b/web/settingsWidget.ts index a0733617..2b2d82fc 100644 --- a/web/settingsWidget.ts +++ b/web/settingsWidget.ts @@ -136,6 +136,7 @@ class SettingsWidget { 'Name:' + escapedRepoName + '
' + SVG_ICONS.pencil + '
' + (this.repo.name !== null ? '
' + SVG_ICONS.close + '
' : '') + '' + 'Initial Branches:' + initialBranchesStr + '
' + SVG_ICONS.pencil + '
' + (initialBranchesLocallyConfigured ? '
' + SVG_ICONS.close + '
' : '') + '' + '' + + '
' + '
' + '' + SVG_ICONS.info + '
' + '' + SVG_ICONS.info + '' + @@ -272,6 +273,16 @@ class SettingsWidget { }); } + const showStashesElem = document.getElementById('settingsShowStashesCheckbox'); + showStashesElem.checked = getShowStashes(this.repo.showStashes); + showStashesElem.addEventListener('change', () => { + if (this.currentRepo === null) return; + const elem = document.getElementById('settingsShowStashesCheckbox'); + if (elem === null) return; + this.view.saveRepoStateValue(this.currentRepo, 'showStashes', elem.checked ? GG.BooleanOverride.Enabled : GG.BooleanOverride.Disabled); + this.view.refresh(true); + }); + const showTagsElem = document.getElementById('settingsShowTagsCheckbox'); showTagsElem.checked = getShowTags(this.repo.showTags); showTagsElem.addEventListener('change', () => {