diff --git a/gitfourchette/tasks/stashtasks.py b/gitfourchette/tasks/stashtasks.py index 08b4bd5f..df577f0c 100644 --- a/gitfourchette/tasks/stashtasks.py +++ b/gitfourchette/tasks/stashtasks.py @@ -5,6 +5,7 @@ # ----------------------------------------------------------------------------- import itertools +import logging from gitfourchette.forms.stashdialog import StashDialog from gitfourchette.localization import * @@ -15,6 +16,8 @@ from gitfourchette.toolbox import * from gitfourchette.trash import Trash +logger = logging.getLogger(__name__) + _indexStatusTable = { "A": FileStatus.INDEX_NEW, "D": FileStatus.INDEX_DELETED, @@ -40,9 +43,10 @@ def backupStash(repo: Repo, stashCommitId: Oid): - trashFile = Trash.instance().newFile(repo.workdir, ext=".txt", originalPath="DELETED_STASH") - - if not trashFile: + try: + trashFile = Trash.instance().newFile(repo.workdir, ext=".txt", originalPath="DELETED_STASH") + except Trash.BackupSkipped as ex: + logger.warning(f"Stash backup skipped: {ex}") return text = F"""\