Fossil Forum

fossil stash save <pattern> incorrect behavior (patch included)
Login

fossil stash save <pattern> incorrect behavior (patch included)

fossil stash save <pattern> incorrect behavior (patch included)

(1.2) By PChemGuy on 2024-05-02 09:28:38 edited from 1.1 [source]

If no changed file matches the pattern provided to

fossil stash save <pattern> incorrect behavior

Fossil throws an error/warning about an open transaction instead of notifying of what actually happened. Below is a fixing patch (against the tip).

Index: src/stash.c
==================================================================
--- src/stash.c
+++ src/stash.c
@@ -593,11 +593,13 @@
       db_finalize(&q);
       newArgv[0] = g.argv[0];
       newArgv[1] = 0;
       g.argv = newArgv;
       g.argc = nFile+2;
-      if( nFile==0 ) return;
+      if( nFile==0 ){
+        fossil_fatal("no changed file matched provided patterns");
+      }
     }
     /* Make sure the stash has committed before running the revert, so that
     ** we have a copy of the changes before deleting them. */
     db_commit_transaction();
     g.argv[1] = "revert";

(2) By Stephan Beal (stephan) on 2024-05-02 10:05:47 in reply to 1.2 [link] [source]

Fossil throws an error/warning about an open transaction instead of notifying of what actually happened.

That's fixed now using a patch very similar to yours. Thank you for the report and patch.