def get_patches_from_dir(path): """Find patches in a subdirectory""" patches = [] for root, subdirs, files in core.walk(path): for name in [f for f in files if f.endswith('.patch')]: patches.append(core.decode(os.path.join(root, name))) return patches
def refresh(self): with self._lock: if self._inotify_fd is None: return try: if not self._refs_only: tracked_dirs = set( os.path.dirname(os.path.join(self._worktree, path)) for path in gitcmds.tracked_files()) self._refresh_watches(tracked_dirs, self._worktree_wds, self._worktree_wd_map) git_dirs = set() git_dirs.add(self._git_dir) for dirpath, dirnames, filenames in core.walk( os.path.join(self._git_dir, 'refs')): git_dirs.add(dirpath) self._refresh_watches(git_dirs, self._git_dir_wds, self._git_dir_wd_map) self._git_dir_wd = self._git_dir_wd_map[self._git_dir] except OSError as e: if e.errno == errno.ENOSPC: self._log_out_of_wds_message() self._running = False else: raise
def refresh(self): with self._lock: if self._inotify_fd is None: return try: if self._worktree is not None: tracked_dirs = set( os.path.dirname(os.path.join(self._worktree, path)) for path in gitcmds.tracked_files()) self._refresh_watches(tracked_dirs, self._worktree_wds, self._worktree_wd_map) git_dirs = set() git_dirs.add(self._git_dir) for dirpath, dirnames, filenames in core.walk( os.path.join(self._git_dir, 'refs')): git_dirs.add(dirpath) self._refresh_watches(git_dirs, self._git_dir_wds, self._git_dir_wd_map) self._git_dir_wd = self._git_dir_wd_map[self._git_dir] except OSError as e: if e.errno == errno.ENOSPC: self._log_out_of_wds_message() self._running = False else: raise