Skip to content

Commit eab81b4

Browse files
committed
git missing docs
1 parent ca9be9f commit eab81b4

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

extensions/git/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,20 +1769,25 @@
17691769
"contents": "%view.workbench.scm.disabled%",
17701770
"when": "!config.git.enabled"
17711771
},
1772+
{
1773+
"view": "workbench.scm",
1774+
"contents": "%view.workbench.scm.missing%",
1775+
"when": "config.git.enabled && git.missing"
1776+
},
17721777
{
17731778
"view": "workbench.scm",
17741779
"contents": "%view.workbench.scm.empty%",
1775-
"when": "config.git.enabled && workbenchState == empty"
1780+
"when": "config.git.enabled && !git.missing && workbenchState == empty"
17761781
},
17771782
{
17781783
"view": "workbench.scm",
17791784
"contents": "%view.workbench.scm.folder%",
1780-
"when": "config.git.enabled && workbenchState == folder"
1785+
"when": "config.git.enabled && !git.missing && workbenchState == folder"
17811786
},
17821787
{
17831788
"view": "workbench.scm",
17841789
"contents": "%view.workbench.scm.workspace%",
1785-
"when": "config.git.enabled && workbenchState == workspace"
1790+
"when": "config.git.enabled && !git.missing && workbenchState == workspace"
17861791
}
17871792
]
17881793
}

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
"colors.ignored": "Color for ignored resources.",
148148
"colors.conflict": "Color for resources with conflicts.",
149149
"colors.submodule": "Color for submodule resources.",
150+
"view.workbench.scm.missing": "A valid git installation was not detected, more details can be found in the [git output](command:git.showOutput).\nPlease [install git](https://git-scm.com/), or learn more about how to use Git and source control in VS Code in [our docs](https://aka.ms/vscode-scm).\nIf you're using a different version control system, you can [search the Marketplace](command:workbench.extensions.search?%22%40category%3A%5C%22scm%20providers%5C%22%22) for additional extensions.",
150151
"view.workbench.scm.disabled": "If you would like to use git features, please enable git in your [settings](command:workbench.action.openSettings?%5B%22git.enabled%22%5D).\nTo learn more about how to use Git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).",
151152
"view.workbench.scm.empty": "In order to use git features, you can open a folder containing a git repository or clone from a URL.\n[Open Folder](command:vscode.openFolder)\n[Clone from URL](command:git.clone)\nTo learn more about how to use Git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).",
152153
"view.workbench.scm.folder": "The folder currently open doesn't have a git repository.\n[Initialize Repository](command:git.init)\nTo learn more about how to use Git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).",

extensions/git/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export async function activate(context: ExtensionContext): Promise<GitExtension>
175175
console.warn(err.message);
176176
outputChannel.appendLine(err.message);
177177

178+
commands.executeCommand('setContext', 'git.missing', true);
178179
warnAboutMissingGit();
179180

180181
return new GitExtensionImpl();

0 commit comments

Comments
 (0)