extension_dir=os.path.join(os.path.abspath(os.path.dirname(__file__)),'../','../')#go up to dir /home/<user>/.config/inkscape/extensions/mightyscape-1.X/
repo=Repo(os.path.join(extension_dir,".git"))
#check if it is a non-empty git repository
ifrepo.bareisFalse:
ifrepo.is_dirty(untracked_files=True)isFalse:
iflen(repo.untracked_files)>0:
ifself.options.stash_untrackedisTrue:
repo.git.stash('save')
else:
inkex.utils.debug("There are some untracked files in your MightyScape directory. Still trying to pull recent files from git...")