| File data/plugins/git/statuses.lua changed (mode: 100644) (index 2146c6215..5dd764edb) |
| ... |
... |
function M.get(at) |
| 224 |
224 |
local node = init_node(make_node(cache, at), expires) |
local node = init_node(make_node(cache, at), expires) |
| 225 |
225 |
node.in_git = true |
node.in_git = true |
| 226 |
226 |
|
|
| 227 |
|
local subdirs = exec(string.format('git -C %s ls-tree -r -d --name-only -z HEAD .', vifm.escape(at))) |
|
| 228 |
|
local subtree_has_changes = false |
|
| 229 |
|
for subdir in string.gmatch(subdirs, '[^\0]+') do |
|
| 230 |
|
if subdir ~= './' and subdir ~= '../' then |
|
| 231 |
|
subtree_has_changes = true |
|
| 232 |
|
|
|
| 233 |
|
local dir = make_node(node, subdir) |
|
| 234 |
|
dir.expires = expires |
|
| 235 |
|
dir.in_git = true |
|
| 236 |
|
dir.status = ' ' |
|
| 237 |
|
end |
|
| 238 |
|
end |
|
| 239 |
|
|
|
| 240 |
|
if not subtree_has_changes then |
|
| 241 |
|
node.status = '' |
|
| 242 |
|
-- no need to call `git status` |
|
| 243 |
|
return node |
|
| 244 |
|
end |
|
| 245 |
|
|
|
| 246 |
227 |
node.past = cached |
node.past = cached |
| 247 |
228 |
fill_node { |
fill_node { |
| 248 |
229 |
node = node, |
node = node, |