diff options
-rw-r--r-- | ranger/ext/vcs/git.py | 2 | ||||
-rw-r--r-- | ranger/ext/vcs/vcs.py | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/ranger/ext/vcs/git.py b/ranger/ext/vcs/git.py index 86a42502..70fcebe3 100644 --- a/ranger/ext/vcs/git.py +++ b/ranger/ext/vcs/git.py @@ -175,7 +175,7 @@ class Git(Vcs): return set( os.path.normpath(p) for p in self._git( - ['ls-files', '--others', '--directory', '--ignored', '--exclude-standard', '-z'], + ['ls-files', '--others', '--ignored', '--exclude-standard', '-z'], catchout=True, bytes=True ).decode('utf-8').split('\x00')[:-1] ) diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index 828ecf14..9e7d5e5b 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -273,13 +273,21 @@ class Vcs(object): # check if path contains some file in status if is_directory: statuses = set( - status for path, status in self.status.items() - if path.startswith(relpath + '/') + status for subpath, status in self.status.items() + if subpath.startswith(relpath + '/') ) for status in self.FILE_STATUS: if status in statuses: return status + # check if all subpaths are ignored + for root, _, files in os.walk(path): + for filename in files: + if os.path.relpath(os.path.join(root, filename), self.root) \ + not in self.ignored: + return 'sync' + return 'ignored' + return 'sync' def get_status_allfiles(self): |