From 5c64d38c45bc489eea08495b0c4052ea53efc56c Mon Sep 17 00:00:00 2001 From: Kenta Yamaguchi Date: Sun, 6 Jul 2025 11:55:03 +0900 Subject: [PATCH] fix: show untracked files when comparing working tree --- lua/diffview/vcs/adapters/git/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/diffview/vcs/adapters/git/init.lua b/lua/diffview/vcs/adapters/git/init.lua index 3a137bc9..37589cc4 100644 --- a/lua/diffview/vcs/adapters/git/init.lua +++ b/lua/diffview/vcs/adapters/git/init.lua @@ -1670,9 +1670,8 @@ function GitAdapter:show_untracked(opt) opt = opt or {} if opt.revs then - -- Never show untracked files when comparing against anything other than - -- the index - if not (opt.revs.left.type == RevType.STAGE and opt.revs.right.type == RevType.LOCAL) then + -- Show untracked files when comparing against the working tree (LOCAL) + if opt.revs.right.type ~= RevType.LOCAL then return false end end