fix(git): only honor -> in porcelain output for renames
This commit is contained in:
@@ -165,10 +165,15 @@ local function parse_porcelain(stdout)
|
||||
local y = line:sub(2, 2)
|
||||
local rest = line:sub(4)
|
||||
local orig
|
||||
local arrow = rest:find(" -> ", 1, true)
|
||||
if arrow then
|
||||
orig = rest:sub(1, arrow - 1)
|
||||
rest = rest:sub(arrow + 4)
|
||||
-- ` -> ` only appears in renames/copies (R/C codes). Without
|
||||
-- this guard, a literal filename containing the arrow would
|
||||
-- be mis-parsed.
|
||||
if x == "R" or x == "C" or y == "R" or y == "C" then
|
||||
local arrow = rest:find(" -> ", 1, true)
|
||||
if arrow then
|
||||
orig = rest:sub(1, arrow - 1)
|
||||
rest = rest:sub(arrow + 4)
|
||||
end
|
||||
end
|
||||
local entry = {
|
||||
section = nil,
|
||||
|
||||
Reference in New Issue
Block a user