Commit 30a3bd2d authored by Kai Willadsen's avatar Kai Willadsen

vc.git: Fix the missing cache sometimes getting relative paths

Specifically, top-level entries in the repository would always have
relative paths put into the missing cache. The meta cache already dealt
with this (albeit weirdly) but now both should have a consistent story
going on.
parent 3d89b3de
...@@ -344,7 +344,8 @@ class Vc(_vc.Vc): ...@@ -344,7 +344,8 @@ class Vc(_vc.Vc):
columns = self.DIFF_RE.search(entry).groups() columns = self.DIFF_RE.search(entry).groups()
old_mode, new_mode, old_sha, new_sha, statekey, path = columns old_mode, new_mode, old_sha, new_sha, statekey, path = columns
state = self.state_map.get(statekey.strip(), _vc.STATE_NONE) state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
self._tree_cache[get_real_path(path)] = state path = get_real_path(path)
self._tree_cache[path] = state
# Git entries can't be MISSING; that's just an unstaged REMOVED # Git entries can't be MISSING; that's just an unstaged REMOVED
self._add_missing_cache_entry(path, state) self._add_missing_cache_entry(path, state)
if old_mode != new_mode: if old_mode != new_mode:
...@@ -359,7 +360,7 @@ class Vc(_vc.Vc): ...@@ -359,7 +360,7 @@ class Vc(_vc.Vc):
_("Partially staged") if path in unstaged else _("Staged")) _("Partially staged") if path in unstaged else _("Staged"))
for path, msgs in tree_meta_cache.items(): for path, msgs in tree_meta_cache.items():
self._tree_meta_cache[get_real_path(path)] = "; ".join(msgs) self._tree_meta_cache[path] = "; ".join(msgs)
for path in ignored_entries: for path in ignored_entries:
self._tree_cache[get_real_path(path)] = _vc.STATE_IGNORED self._tree_cache[get_real_path(path)] = _vc.STATE_IGNORED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment