Skip to content

Commit 060a625

Browse files
committed
fix: Do not pass "--path-format=absolute" to rev-parse calls.
Older git versions do not support this flag and it breaks functionality for them. Also it appears not to do anything in this context.
1 parent a1fc4e5 commit 060a625

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/neogit/lib/git/cli.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ local configurations = {
981981
---@param dir string
982982
---@return string Absolute path of current worktree
983983
local function worktree_root(dir)
984-
local cmd = { "git", "-C", dir, "rev-parse", "--show-toplevel", "--path-format=absolute" }
984+
local cmd = { "git", "-C", dir, "rev-parse", "--show-toplevel" }
985985
local result = vim.system(cmd, { text = true }):wait()
986986

987987
return Path:new(vim.trim(result.stdout)):absolute()
@@ -990,7 +990,7 @@ end
990990
---@param dir string
991991
---@return string Absolute path of `.git/` directory
992992
local function git_dir(dir)
993-
local cmd = { "git", "-C", dir, "rev-parse", "--git-common-dir", "--path-format=absolute" }
993+
local cmd = { "git", "-C", dir, "rev-parse", "--git-common-dir" }
994994
local result = vim.system(cmd, { text = true }):wait()
995995

996996
return Path:new(vim.trim(result.stdout)):absolute()
@@ -999,7 +999,7 @@ end
999999
---@param dir string
10001000
---@return string Absolute path of `.git/` directory
10011001
local function worktree_git_dir(dir)
1002-
local cmd = { "git", "-C", dir, "rev-parse", "--git-dir", "--path-format=absolute" }
1002+
local cmd = { "git", "-C", dir, "rev-parse", "--git-dir" }
10031003
local result = vim.system(cmd, { text = true }):wait()
10041004

10051005
return Path:new(vim.trim(result.stdout)):absolute()

0 commit comments

Comments
 (0)