Fossil SCM

If there is nothing to stash, issue an error.

andybradford 2019-08-31 17:09 trunk
Commit d959c48ac6c34057c4b0d38c6b0c77aa8fbe74550528d4e5b30ae1cafd18393e
1 file changed +3
--- src/stash.c
+++ src/stash.c
@@ -589,10 +589,13 @@
589589
}else{
590590
zCmd = g.argv[2];
591591
}
592592
nCmd = strlen(zCmd);
593593
if( memcmp(zCmd, "save", nCmd)==0 ){
594
+ if( unsaved_changes(0)==0 ){
595
+ fossil_fatal("nothing to stash");
596
+ }
594597
stashid = stash_create();
595598
undo_disable();
596599
if( g.argc>=2 ){
597600
int nFile = db_int(0, "SELECT count(*) FROM stashfile WHERE stashid=%d",
598601
stashid);
599602
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button