Skip to content

Commit a6906ce

Browse files
committed
fix(file-history): Regression in path resolution. (fixes #250)
1 parent d5662d4 commit a6906ce

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lua/diffview/lib.lua

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ local utils = lazy.require("diffview.utils") ---@module "diffview.utils"
1111

1212
local api = vim.api
1313

14-
---@type PathLib
15-
local pl = lazy.access(utils, "path")
16-
1714
local M = {}
1815

1916
---@type View[]
@@ -74,7 +71,6 @@ end
7471
function M.file_history(range, args)
7572
local default_args = config.get_config().default_args.DiffviewFileHistory
7673
local argo = arg_parser.parse(vim.tbl_flatten({ default_args, args }))
77-
local rel_paths
7874

7975
logger.info("[command call] :DiffviewFileHistory " .. table.concat(vim.tbl_flatten({
8076
default_args,
@@ -95,11 +91,7 @@ function M.file_history(range, args)
9591

9692
---@cast adapter -?
9793

98-
rel_paths = vim.tbl_map(function(v)
99-
return v == "." and "." or pl:relative(v, ".")
100-
end, adapter.ctx.path_args)
101-
102-
local log_options = adapter:file_history_options(range, rel_paths, args)
94+
local log_options = adapter:file_history_options(range, adapter.ctx.path_args, args)
10395

10496
if log_options == nil then
10597
return

lua/diffview/vcs/adapters/git/init.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ function GitAdapter:file_history_options(range, paths, args)
626626
local argo = arg_parser.parse(vim.tbl_flatten({ default_args, args }))
627627
local rel_paths
628628

629-
local cpath = argo:get_flag("C", { no_empty = true, expand = true })
630629
local cfile = pl:vim_expand("%")
631630
cfile = pl:readlink(cfile) or cfile
632631

@@ -636,11 +635,6 @@ function GitAdapter:file_history_options(range, paths, args)
636635
return v == "." and "." or pl:relative(v, ".")
637636
end, paths)
638637

639-
local cwd = cpath or vim.loop.cwd()
640-
paths = vim.tbl_map(function(pathspec)
641-
return pathspec_expand(self.ctx.toplevel, cwd, pathspec)
642-
end, paths) --[[@as string[] ]]
643-
644638
---@type string
645639
local range_arg = argo:get_flag("range", { no_empty = true })
646640
if range_arg then

0 commit comments

Comments
 (0)