def set_worktree(self, worktree): self.git.set_worktree(worktree) is_valid = self.git.is_valid() if is_valid: cwd = self.git.getcwd() self.project = os.path.basename(cwd) self.set_directory(cwd) core.chdir(cwd) gitcfg.current().reset() return is_valid
def do(self): git = self.model.git old_worktree = git.worktree() if not self.model.set_worktree(self.repo_path): self.model.set_worktree(old_worktree) return new_worktree = git.worktree() core.chdir(new_worktree) self.model.set_directory(self.repo_path) _config.reset() self.model.update_status()
def do(self): git = self.model.git old_worktree = git.worktree() if not self.model.set_worktree(self.repo_path): self.model.set_worktree(old_worktree) return new_worktree = git.worktree() core.chdir(new_worktree) self.model.set_directory(self.repo_path) cfg = gitcfg.current() cfg.reset() inotify.stop() inotify.start() self.model.update_status()