Skip to content

Commit 633811c

Browse files
hlmtrealex-courtis
andauthored
fix: harden git status updates (#2533)
* fix for nil status error messages * simplify logic --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
1 parent 52a1c99 commit 633811c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lua/nvim-tree/explorer/node.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ local function get_dir_git_status(parent_ignored, status, absolute_path)
1414
return { file = "!!" }
1515
end
1616

17-
return {
18-
file = status.files and status.files[absolute_path],
19-
dir = status.dirs and {
20-
direct = status.dirs.direct[absolute_path],
21-
indirect = status.dirs.indirect[absolute_path],
22-
},
23-
}
17+
if status then
18+
return {
19+
file = status.files and status.files[absolute_path],
20+
dir = status.dirs and {
21+
direct = status.dirs.direct[absolute_path],
22+
indirect = status.dirs.indirect[absolute_path],
23+
},
24+
}
25+
end
2426
end
2527

2628
local function get_git_status(parent_ignored, status, absolute_path)

0 commit comments

Comments
 (0)