Skip to content

Commit 14d47d3

Browse files
committed
1 parent 6884154 commit 14d47d3

2 files changed

Lines changed: 10 additions & 20 deletions

File tree

extensions/git/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,11 @@
469469
},
470470
{
471471
"command": "git.clean",
472-
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
472+
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
473473
},
474474
{
475475
"command": "git.cleanAll",
476-
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
476+
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
477477
},
478478
{
479479
"command": "git.commit",
@@ -763,7 +763,7 @@
763763
{
764764
"command": "git.cleanAll",
765765
"group": "5_stage",
766-
"when": "scmProvider == git && !gitFreshRepository"
766+
"when": "scmProvider == git"
767767
},
768768
{
769769
"command": "git.stashIncludeUntracked",
@@ -831,7 +831,7 @@
831831
},
832832
{
833833
"command": "git.cleanAll",
834-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
834+
"when": "scmProvider == git && scmResourceGroup == workingTree",
835835
"group": "1_modification"
836836
},
837837
{
@@ -841,7 +841,7 @@
841841
},
842842
{
843843
"command": "git.cleanAll",
844-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
844+
"when": "scmProvider == git && scmResourceGroup == workingTree",
845845
"group": "inline"
846846
},
847847
{
@@ -878,12 +878,12 @@
878878
},
879879
{
880880
"command": "git.clean",
881-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
881+
"when": "scmProvider == git && scmResourceGroup == workingTree",
882882
"group": "1_modification"
883883
},
884884
{
885885
"command": "git.clean",
886-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
886+
"when": "scmProvider == git && scmResourceGroup == workingTree",
887887
"group": "inline"
888888
},
889889
{
@@ -980,12 +980,12 @@
980980
},
981981
{
982982
"command": "git.clean",
983-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
983+
"when": "scmProvider == git && scmResourceGroup == workingTree",
984984
"group": "1_modification"
985985
},
986986
{
987987
"command": "git.clean",
988-
"when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
988+
"when": "scmProvider == git && scmResourceGroup == workingTree",
989989
"group": "inline"
990990
},
991991
{

extensions/git/src/repository.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { commands, Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, SourceControlInputBoxValidation, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, Decoration, Memento, SourceControlInputBoxValidationType, OutputChannel, LogLevel, env, ProgressOptions, CancellationToken } from 'vscode';
6+
import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, SourceControlInputBoxValidation, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, Decoration, Memento, SourceControlInputBoxValidationType, OutputChannel, LogLevel, env, ProgressOptions, CancellationToken } from 'vscode';
77
import { Repository as BaseRepository, Commit, Stash, GitError, Submodule, CommitOptions, ForcePushMode } from './git';
88
import { anyEvent, filterEvent, eventToPromise, dispose, find, isDescendant, IDisposable, onceEvent, EmptyDisposable, debounceEvent, combinedDisposable } from './util';
99
import { memoize, throttle, debounce } from './decorators';
@@ -633,7 +633,6 @@ export class Repository implements Disposable {
633633

634634
private isRepositoryHuge = false;
635635
private didWarnAboutLimit = false;
636-
private isFreshRepository: boolean | undefined = undefined;
637636

638637
private disposables: Disposable[] = [];
639638

@@ -1507,15 +1506,6 @@ export class Repository implements Disposable {
15071506
// set count badge
15081507
this.setCountBadge();
15091508

1510-
// Disable `Discard All Changes` for "fresh" repositories
1511-
// https://github.com/Microsoft/vscode/issues/43066
1512-
const isFreshRepository = !this._HEAD || !this._HEAD.commit;
1513-
1514-
if (this.isFreshRepository !== isFreshRepository) {
1515-
commands.executeCommand('setContext', 'gitFreshRepository', isFreshRepository);
1516-
this.isFreshRepository = isFreshRepository;
1517-
}
1518-
15191509
this._onDidChangeStatus.fire();
15201510
}
15211511

0 commit comments

Comments
 (0)