Skip to content

Commit b5697de

Browse files
KEY60228dlyongemallo
authored andcommitted
fix(git): show untracked files when comparing working tree (sindrets#587)
Show untracked files when the right side of the comparison is the working tree (LOCAL), not just when comparing index vs working tree. This allows seeing untracked files in more diff scenarios. Fixes sindrets#584
1 parent 75cf106 commit b5697de

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,9 +1674,8 @@ function GitAdapter:show_untracked(opt)
16741674
opt = opt or {}
16751675

16761676
if opt.revs then
1677-
-- Never show untracked files when comparing against anything other than
1678-
-- the index
1679-
if not (opt.revs.left.type == RevType.STAGE and opt.revs.right.type == RevType.LOCAL) then
1677+
-- Show untracked files when comparing against the working tree (LOCAL)
1678+
if opt.revs.right.type ~= RevType.LOCAL then
16801679
return false
16811680
end
16821681
end

0 commit comments

Comments
 (0)