Skip to content

Commit

Permalink
fix: do not error if cwd does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Dec 15, 2022
1 parent b0d16a6 commit 2f3e3e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/gitsigns/git.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions teal/gitsigns/git.tl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ M.command = wrap(function(args: {string}, spec: GJobSpec, callback: function({st
spec.command = spec.command or 'git'
spec.args = spec.command == 'git' and
{ '--no-pager', '--literal-pathspecs', unpack(args) } or args

if not spec.cwd and not uv.cwd() then
spec.cwd = vim.env.HOME
end

subprocess.run_job(spec as JobSpec, function(_: integer, _: integer, stdout: string, stderr: string)
if not spec.suppress_stderr then
if stderr then
Expand Down
2 changes: 2 additions & 0 deletions types/vim.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ local record M
-- Assume result_type == 'indices'
diff: function(string|{string}, string|{string}, table): {DiffResult}

env: {string:string}

record go
operatorfunc: string
end
Expand Down

0 comments on commit 2f3e3e4

Please sign in to comment.