496 |
496 |
497 dlg = GitWorktreeAddDialog( |
497 dlg = GitWorktreeAddDialog( |
498 parentDirectory, |
498 parentDirectory, |
499 self.__vcs.gitGetTagsList(self.__repodir), |
499 self.__vcs.gitGetTagsList(self.__repodir), |
500 self.__vcs.gitGetBranchesList(self.__repodir), |
500 self.__vcs.gitGetBranchesList(self.__repodir), |
|
501 parent=self, |
501 ) |
502 ) |
502 if dlg.exec() == QDialog.DialogCode.Accepted: |
503 if dlg.exec() == QDialog.DialogCode.Accepted: |
503 params = dlg.getParameters() |
504 params = dlg.getParameters() |
504 args = ["worktree", "add"] |
505 args = ["worktree", "add"] |
505 if params["force"]: |
506 if params["force"]: |
514 args += ["-B" if params["force_branch"] else "-b", params["branch"]] |
515 args += ["-B" if params["force_branch"] else "-b", params["branch"]] |
515 args.append(params["path"]) |
516 args.append(params["path"]) |
516 if params["commit"]: |
517 if params["commit"]: |
517 args.append(params["commit"]) |
518 args.append(params["commit"]) |
518 |
519 |
519 dlg = GitDialog(self.tr("Add Worktree"), self.__vcs) |
520 dlg = GitDialog(self.tr("Add Worktree"), self.__vcs, parent=self) |
520 started = dlg.startProcess(args, workingDir=self.__repodir) |
521 started = dlg.startProcess(args, workingDir=self.__repodir) |
521 if started: |
522 if started: |
522 dlg.exec() |
523 dlg.exec() |
523 |
524 |
524 self.__refreshButtonClicked() |
525 self.__refreshButtonClicked() |
786 parentDirectory = os.path.dirname(itm.text(self.__pathColumn)) |
787 parentDirectory = os.path.dirname(itm.text(self.__pathColumn)) |
787 break |
788 break |
788 else: |
789 else: |
789 parentDirectory = "" |
790 parentDirectory = "" |
790 |
791 |
791 dlg = GitWorktreePathsDialog(parentDirectory, self) |
792 dlg = GitWorktreePathsDialog(parentDirectory, parent=self) |
792 if dlg.exec() == QDialog.DialogCode.Accepted: |
793 if dlg.exec() == QDialog.DialogCode.Accepted: |
793 paths = dlg.getPathsList() |
794 paths = dlg.getPathsList() |
794 |
795 |
795 if paths: |
796 if paths: |
796 self.__worktreeRepair(worktreePaths=paths) |
797 self.__worktreeRepair(worktreePaths=paths) |