Skip to content

Commit 998035a

Browse files
committedFeb 28, 2025
fix(treesitter): remove unnecessary git checkout on tree-sitter install
1 parent 2eebc98 commit 998035a

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed
 

‎lua/orgmode/utils/treesitter/install.lua

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
local Promise = require('orgmode.utils.promise')
22
local utils = require('orgmode.utils')
3-
local ts_revision = 'f8c6b1e72f82f17e41004e04e15f62a83ecc27b0'
43
local uv = vim.uv
54
local M = {
65
compilers = { vim.fn.getenv('CC'), 'cc', 'gcc', 'clang', 'cl', 'zig' },
@@ -136,22 +135,12 @@ function M.get_path(url, type)
136135
utils.echo_info(('%s tree-sitter grammar...'):format(msg[type]))
137136
return M.exe('git', {
138137
args = { 'clone', '--filter=blob:none', '--depth=1', '--branch=' .. required_version, url, path },
139-
})
140-
:next(function(code)
141-
if code ~= 0 then
142-
error('[orgmode] Failed to clone tree-sitter-org', 0)
143-
end
144-
return M.exe('git', {
145-
args = { 'checkout', ts_revision },
146-
cwd = path,
147-
})
148-
end)
149-
:next(function(code)
150-
if code ~= 0 then
151-
error('[orgmode] Failed to checkout to correct revision on tree-sitter-org', 0)
152-
end
153-
return path
154-
end)
138+
}):next(function(code)
139+
if code ~= 0 then
140+
error('[orgmode] Failed to clone tree-sitter-org', 0)
141+
end
142+
return path
143+
end)
155144
end
156145

157146
---@param type? 'install' | 'update' | 'reinstall''

0 commit comments

Comments
 (0)