diff --git a/lua/octo/utils.lua b/lua/octo/utils.lua index 8cff8509..19b0bf10 100644 --- a/lua/octo/utils.lua +++ b/lua/octo/utils.lua @@ -362,13 +362,10 @@ function M.get_file_at_commit(path, commit, cb) enable_recording = true, command = "git", args = { "show", string.format("%s:%s", commit, path) }, - on_exit = vim.schedule_wrap(function(j_self, _, _) - local output = table.concat(j_self:result(), "\n") - local stderr = table.concat(j_self:stderr_result(), "\n") - cb(vim.split(output, "\n"), vim.split(stderr, "\n")) - end), } - job:start() + local result = job:sync() + local output = table.concat(result, "\n") + cb(vim.split(output, "\n")) end function M.in_pr_repo()