Skip to content

Commit

Permalink
fsmonitor: fix mistyped fs_to_path_map variable
Browse files Browse the repository at this point in the history
A typo was made in facfd59 when the
wd_set variable was renamed to wd_to_path_map.  This code path
raises a NameError when inotify-watched files are removed from
the filesystem:

NameError: global name 'wd_to_path_set' is not defined

Closes #607
Reported-by: Joshua Taylor <joshuataylorx@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Oct 11, 2016
1 parent 0cebb3c commit 08a9e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cola/fsmonitor.py
Expand Up @@ -260,7 +260,7 @@ def _refresh_watches(self, paths_to_watch, wd_to_path_map,
watched_paths = set(path_to_wd_map)
for path in watched_paths - paths_to_watch:
wd = path_to_wd_map.pop(path)
wd_to_path_set.pop(wd)
wd_to_path_map.pop(wd)
try:
inotify.rm_watch(self._inotify_fd, wd)
except OSError as e:
Expand Down
4 changes: 4 additions & 0 deletions share/doc/git-cola/relnotes.rst
Expand Up @@ -75,6 +75,10 @@ Fixes

https://github.com/git-cola/git-cola/issues/604

* Fixed a typo in the inotify backend that is triggered when files are removed.

https://github.com/git-cola/git-cola/issues/607

.. _v2.8:

git-cola v2.8
Expand Down

2 comments on commit 08a9e55

@sthalik
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having a problem where switching branches or possibly other operations caused intermittent showing all files as modified until next manual refresh. Could this have been the cause?

@living180
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt they are related. The fsmonitor code doesn't do any refreshing itself - it simply triggers a normal refresh (the same way as a manual refresh). If perhaps there is some sort of race in the refresh code, then I suppose there is a possibility that the fsmonitor code could be tickling it, but I don't think it likely.

Please sign in to comment.