Commit 87fb349
committed
Fix stash deletion failing when trash is disabled
backupStash() called Trash.newFile(), which raises Trash.BackupSkipped
when the trash is disabled (maxTrashFiles == 0). backupStash did not
catch it, so DropStash and 'apply and delete' aborted with an error and
the stash was never removed. The dead 'if not trashFile' guard assumed
newFile() returns None, which it never does.
Catch Trash.BackupSkipped and skip the backup, matching how DiscardFiles
handles the same exception.1 parent 8998236 commit 87fb349
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
0 commit comments