Skip to content

Commit 96d3208

Browse files
committed
Make git path configurable
closes #90
1 parent 1b74535 commit 96d3208

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,13 @@ Please consider opening an issue or PR if you think a certain action or option w
174174
"git-log--graph.custom-css": {
175175
"description": "An abitrary string of CSS that will be injected into the main web view. Example: * { text-transform: uppercase; }",
176176
"type": "string",
177-
"default": "",
177+
"default": ""
178178
},
179+
"git-log--graph.git-path": {
180+
"description": "Absolute path to the git executable. If not set, it is expected to be on your $PATH.",
181+
"type": "string",
182+
"default": ""
183+
},
179184
}
180185
```
181186

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
"type": "string",
146146
"default": ""
147147
},
148+
"git-log--graph.git-path": {
149+
"description": "Absolute path to the git executable. If not set, it is expected to be on your $PATH.",
150+
"type": "string",
151+
"default": ""
152+
},
148153
"git-log--graph.actions.global": {
149154
"description": "Please check the extension's README for documentation. BE CAREFUL EDITING THESE OPTIONS.",
150155
"type": "array",

src/git.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ module.exports.get_git = (EXT_ID, log, { on_repo_external_state_change, on_repo_
8181
run: (###* @type string ### args, ###* @type {number|undefined} ### repo_index) =>
8282
repo_index ?= selected_repo_index
8383
cwd = vscode.workspace.getConfiguration(EXT_ID).get('folder')
84+
cmd = vscode.workspace.getConfiguration(EXT_ID).get('git-path') || 'git'
8485
if not cwd
8586
repo = api.repositories[repo_index]
8687
if not repo and repo_index > 0
@@ -91,7 +92,7 @@ module.exports.get_git = (EXT_ID, log, { on_repo_external_state_change, on_repo_
9192
throw "No repository selected"
9293
cwd = repo.rootUri.fsPath
9394
try
94-
{ stdout, stderr: _ } = await exec 'git ' + args,
95+
{ stdout, stderr: _ } = await exec cmd + ' ' + args,
9596
cwd: cwd
9697
# 35 MB. For scale, Linux kernel git graph (1 mio commits) in extension format
9798
# is 538 MB or 7.4 MB for the first 15k commits

0 commit comments

Comments
 (0)