From a803708bcb1cf163417d11f39a50dc4bd998224a Mon Sep 17 00:00:00 2001 From: Zackary Schreur Date: Fri, 28 Jun 2024 09:12:52 -0400 Subject: [PATCH] bugfix: set cwd when running a jj command fixes #12 --- lua/telescope-jj/conflicts.lua | 2 +- lua/telescope-jj/diff.lua | 2 +- lua/telescope-jj/files.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/telescope-jj/conflicts.lua b/lua/telescope-jj/conflicts.lua index bfb45b6..1a65a0f 100644 --- a/lua/telescope-jj/conflicts.lua +++ b/lua/telescope-jj/conflicts.lua @@ -12,7 +12,7 @@ return function(opts) end local cmd = { "jj", "resolve", "--list" } - local cmd_output = utils.get_os_command_output(cmd) + local cmd_output = utils.get_os_command_output(cmd, opts.cwd) local results = {} for _, str in ipairs(cmd_output) do diff --git a/lua/telescope-jj/diff.lua b/lua/telescope-jj/diff.lua index 13bc88e..fac8127 100644 --- a/lua/telescope-jj/diff.lua +++ b/lua/telescope-jj/diff.lua @@ -12,7 +12,7 @@ return function(opts) end local cmd = { "jj", "diff", "--summary", "--no-pager" } - local cmd_output = utils.get_os_command_output(cmd) + local cmd_output = utils.get_os_command_output(cmd, opts.cwd) local results = {} for _, str in ipairs(cmd_output) do diff --git a/lua/telescope-jj/files.lua b/lua/telescope-jj/files.lua index cd11794..8a1b499 100644 --- a/lua/telescope-jj/files.lua +++ b/lua/telescope-jj/files.lua @@ -18,7 +18,7 @@ return function(opts) prompt_title = "Jujutsu Files", __locations_input = true, finder = finders.new_table({ - results = utils.get_os_command_output(cmd), + results = utils.get_os_command_output(cmd, opts.cwd), entry_maker = opts.entry_maker or make_entry.gen_from_file(opts), }), previewer = conf.file_previewer(opts),