[Diff][Fixed] problems when using things like "origin/main"

- and add_link_id

Fixes #589
This commit is contained in:
Salvador E. Tropea 2024-03-05 10:18:29 -03:00
parent c107695278
commit d66188014c
2 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Filters: _none filter not always honored (i.e. exclude in BoM) (#580)
- PCB Parity: components excluded from the board reported anyways (#585)
- BoardView: X axis mirroring issues (whitequark/kicad-boardview#11)
- Present: Problems when using gerbers already generated
- Present: problems when using gerbers already generated
- Diff: problems when using things like "origin/main" and add_link_id (#589)
## [1.6.4] - 2024-02-02
### Added

View File

@ -486,7 +486,10 @@ class DiffOptions(AnyDiffOptions):
GS.exit_with_error(None, FAILED_EXECUTE, e)
if self.add_link_id:
name_comps = os.path.splitext(name_ori)
target = name_comps[0]+'_'+gh1+'-'+gh2+name_comps[1]
extra = '_'+gh1+'-'+gh2
# Replace things like "origin/main" by "origin_main"
extra = extra.replace('/', '_')
target = name_comps[0]+extra+name_comps[1]
if self.copy_instead_of_link:
copy2(name, target)
else: