From 8a69f0349cf41a57e68a5e1d5b2cb250bb6ede95 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 15 Jan 2024 09:46:25 -0300 Subject: [PATCH] [Diff][Fixed] Problems when trying to use an already existent worktree Fixes #555 --- CHANGELOG.md | 1 + kibot/out_diff.py | 2 +- kibot/out_kiri.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3e92d9..4a7b0abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,6 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Diff - `current`: didn't apply global variants - `current`: didn't honor KiCad native DNP flags, they need a filter + - Problems when trying to use an already existent worktree (#555) - PCB Print: - Issues when forcing the board edge and using scaling (#532) - Text not searchable when using newer rsvg-convert tools (#552) diff --git a/kibot/out_diff.py b/kibot/out_diff.py index 9c9521cb..5d718368 100644 --- a/kibot/out_diff.py +++ b/kibot/out_diff.py @@ -373,7 +373,7 @@ class DiffOptions(AnyDiffOptions): name = self.solve_git_name(name) git_tmp_wd = mkdtemp() logger.debug('Checking out '+name+' to '+git_tmp_wd) - self.run_git(['worktree', 'add', git_tmp_wd, name]) + self.run_git(['worktree', 'add', '--force', git_tmp_wd, name]) self._worktrees_to_remove.append(git_tmp_wd) self.run_git(['submodule', 'update', '--init', '--recursive'], cwd=git_tmp_wd) name_copy = self.run_git(['ls-files', '--full-name', self.file]) diff --git a/kibot/out_kiri.py b/kibot/out_kiri.py index 98431ecc..2c9fde65 100644 --- a/kibot/out_kiri.py +++ b/kibot/out_kiri.py @@ -285,7 +285,7 @@ class KiRiOptions(AnyDiffOptions): rmtree(dst_dir) git_tmp_wd = mkdtemp() logger.debug('Checking out '+hash+' to '+git_tmp_wd) - self.run_git(['worktree', 'add', git_tmp_wd, hash]) + self.run_git(['worktree', 'add', '--force', git_tmp_wd, hash]) self.run_git(['submodule', 'update', '--init', '--recursive'], cwd=git_tmp_wd) # Generate SVGs for the schematic name_sch = self.do_cache(self.sch_rel_name, git_tmp_wd, hash)