@@ -10,6 +10,10 @@ local entry_display = require "telescope.pickers.entry_display"
1010local strings = require " plenary.strings"
1111local Path = require " plenary.path"
1212
13+ -- qqq
14+ local U = require " plenary.utils"
15+ -- !qqq
16+
1317local conf = require (" telescope.config" ).values
1418local git_command = utils .__git_command
1519
@@ -46,6 +50,10 @@ git.files = function(opts)
4650 git_command ({ " -c" , " core.quotepath=false" , " ls-files" , " --exclude-standard" , " --cached" }, opts )
4751 )
4852
53+ -- qqq
54+ -- vim.notify("git.files: " .. vim.inspect(opts), vim.log.levels.ERROR)
55+ -- !qqq
56+
4957 pickers
5058 .new (opts , {
5159 prompt_title = " Git Files" ,
@@ -191,6 +199,13 @@ git.bcommits = function(opts)
191199 opts .git_command =
192200 vim .F .if_nil (opts .git_command , git_command ({ " log" , " --pretty=oneline" , " --abbrev-commit" , " --follow" }, opts ))
193201
202+ -- qqq
203+ -- vim.notify("git.bcommits: " .. vim.inspect(git_command) .. ", " .. vim.inspect(opts), vim.log.levels.ERROR)
204+ -- if U.is_msys2 then
205+ -- opts.current_file = U.posix_to_windows(opts.current_file)
206+ -- end
207+ -- !qqq
208+
194209 local title = " Git BCommits"
195210 local finder = finders .new_oneshot_job (
196211 utils .flatten {
@@ -371,6 +386,18 @@ git.status = function(opts)
371386
372387 local args = { " status" , " --porcelain=v1" , " --" , " ." }
373388
389+ -- qqq
390+ -- Running "nvim ."->":Telescope git_status" ends up with posix-style path.
391+ -- UPD. It gets fixed in later invocations.
392+ -- if opts.cwd:find("^/") then
393+ -- if U.is_msys2 then
394+ -- opts.cwd = U.posix_to_windows(opts.cwd)
395+ -- end
396+ -- --vim.notify("git.status: opts.cwd = " .. vim.inspect(opts.cwd), vim.log.levels.ERROR)
397+ -- --error(debug.traceback())
398+ -- end
399+ -- !qqq
400+
374401 local gen_new_finder = function ()
375402 if vim .F .if_nil (opts .expand_dir , true ) then
376403 table.insert (args , # args - 1 , " -uall" )
@@ -404,6 +431,13 @@ git.status = function(opts)
404431 end
405432 end
406433
434+ -- qqq
435+ -- If we have no changes and status is empty why git_status does not exit
436+ -- with notification? Is it supposed to be like that, right?
437+ -- On "v0.1.8" version I get notification and Telescope just exits as it should be.
438+ -- vim.notify("git.status: self.finder = " .. vim.inspect(self.finder) .. ", count = " .. vim.inspect(count) .. ", prompt = " .. vim.inspect(prompt) , vim.log.levels.WARN)
439+ -- !qqq
440+
407441 if count == 0 and prompt == " " then
408442 utils .notify (" builtin.git_status" , {
409443 msg = " No changes found" ,
@@ -479,6 +513,15 @@ local set_opts_cwd = function(opts)
479513 opts .cwd = vim .loop .cwd ()
480514 end
481515
516+ -- qqq
517+ -- Running "nvim ."->":Telescope git_status" ends up with posix-style path
518+ -- vim.notify("set_opts_cwd: opts = " .. vim.inspect(opts), vim.log.levels.ERROR)
519+ -- error(debug.traceback())
520+ if U .is_msys2 then
521+ opts .cwd = U .posix_to_windows (opts .cwd )
522+ end
523+ -- !qqq
524+
482525 local toplevel , ret = utils .get_os_command_output ({ " git" , " rev-parse" , " --show-toplevel" }, opts .cwd )
483526
484527 if ret ~= 0 then
0 commit comments