MestreLion / git-tools

Assorted git tools, including git-restore-mtime
GNU General Public License v3.0
295 stars 74 forks source link

restore-mtime: AttributeError: 'Git' object has no attribute '_proc' #53

Closed willemw12 closed 2 years ago

willemw12 commented 2 years ago

git-restore-mtime prints a stack trace when it is in a folder without a .git subfolder.

~/bin/git-restore-mtime
Exception ignored in: <function Git.__del__ at 0x7efd82eb01f0>
Traceback (most recent call last):
  File "/home/willem/bin/git-restore-mtime", line 364, in __del__
    self.terminate()
  File "/home/willem/bin/git-restore-mtime", line 331, in terminate
    if self._proc is None:
AttributeError: 'Git' object has no attribute '_proc'

To reproduce: copy git-restore-mtime to another folder that does not contain a .git folder and run that copy or delete the git-tools/.git folder.

Python 3.10.5. Git 2.37.1. Arch Linux.

This did not happen in an older version (commit g12202fd).

(I created a git-tools (development) package in the Arch Linux AUR: https://aur.archlinux.org/packages/git-tools-git.)

MestreLion commented 2 years ago

Thanks for spotting this!

That bug was actually introduced much earlier, but not triggered until another bug was fixed in a00b55033fceecf8a800ea00ab02329a7f8fc214

I'll create a bugfix release later this month, just waiting for more user feedback and reports.