Fossil SCM
If there is nothing to stash, issue an error.
Commit
d959c48ac6c34057c4b0d38c6b0c77aa8fbe74550528d4e5b30ae1cafd18393e
Parent
f304ba31fe42e2d…
1 file changed
+3
+3
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -589,10 +589,13 @@ | ||
| 589 | 589 | }else{ |
| 590 | 590 | zCmd = g.argv[2]; |
| 591 | 591 | } |
| 592 | 592 | nCmd = strlen(zCmd); |
| 593 | 593 | if( memcmp(zCmd, "save", nCmd)==0 ){ |
| 594 | + if( unsaved_changes(0)==0 ){ | |
| 595 | + fossil_fatal("nothing to stash"); | |
| 596 | + } | |
| 594 | 597 | stashid = stash_create(); |
| 595 | 598 | undo_disable(); |
| 596 | 599 | if( g.argc>=2 ){ |
| 597 | 600 | int nFile = db_int(0, "SELECT count(*) FROM stashfile WHERE stashid=%d", |
| 598 | 601 | stashid); |
| 599 | 602 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -589,10 +589,13 @@ | |
| 589 | }else{ |
| 590 | zCmd = g.argv[2]; |
| 591 | } |
| 592 | nCmd = strlen(zCmd); |
| 593 | if( memcmp(zCmd, "save", nCmd)==0 ){ |
| 594 | stashid = stash_create(); |
| 595 | undo_disable(); |
| 596 | if( g.argc>=2 ){ |
| 597 | int nFile = db_int(0, "SELECT count(*) FROM stashfile WHERE stashid=%d", |
| 598 | stashid); |
| 599 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -589,10 +589,13 @@ | |
| 589 | }else{ |
| 590 | zCmd = g.argv[2]; |
| 591 | } |
| 592 | nCmd = strlen(zCmd); |
| 593 | if( memcmp(zCmd, "save", nCmd)==0 ){ |
| 594 | if( unsaved_changes(0)==0 ){ |
| 595 | fossil_fatal("nothing to stash"); |
| 596 | } |
| 597 | stashid = stash_create(); |
| 598 | undo_disable(); |
| 599 | if( g.argc>=2 ){ |
| 600 | int nFile = db_int(0, "SELECT count(*) FROM stashfile WHERE stashid=%d", |
| 601 | stashid); |
| 602 |