Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions gitfourchette/tasks/stashtasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# -----------------------------------------------------------------------------

import itertools
import logging

from gitfourchette.forms.stashdialog import StashDialog
from gitfourchette.localization import *
Expand All @@ -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,
Expand All @@ -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"""\
Expand Down