Index: src/stash.c ================================================================== --- src/stash.c +++ src/stash.c @@ -278,10 +278,15 @@ } blob_reset(&delta); if( fossil_strcmp(zOrig,zNew)!=0 ){ undo_save(zOrig); file_delete(zOPath); + db_multi_exec( + "UPDATE vfile SET pathname='%q', origname='%q'" + " WHERE pathname='%q' %s AND vid=%d", + zNew, zOrig, zOrig, filename_collation(), vid + ); } } stash_add_files_in_sfile(vid); db_finalize(&q); if( nConflict ){ Index: test/stash.test ================================================================== --- test/stash.test +++ test/stash.test @@ -190,15 +190,13 @@ ADDED f0 } -changes { ADDED f0 MISSING f1 EDITED f2 - MISSING f3 + RENAMED f3n } -addremove { - ADDED f3n DELETED f1 - DELETED f3 } -exists {f0 f2 f3n} -notexists {f1 f3} # Confirm there is no longer a stash saved fossil stash list test stash-2-list {[first_data_line] eq "empty stash"} @@ -295,14 +293,13 @@ write_file f2 "f2" fossil add f1 f2 fossil commit -m "baseline" fossil mv --hard f2 f2n -test_result_state stash-3-4-mv "mv --hard f2 f2n" { - RENAME f2 f2n - MOVED_FILE f2 -} -changes { +test_result_state stash-3-2-mv "mv --hard f2 f2n" \ + "RENAME f2 f2n\n MOVED_FILE [file normalize f2]" \ +-changes { RENAMED f2n } -addremove { } -exists {f1 f2n} -notexists {f2} stash-test 3-2 {save -m f2n} { @@ -316,12 +313,10 @@ UPDATE f1 UPDATE f2n } -changes { RENAMED f2n } -addremove { - ADDED f2n - DELETED f2 } -exists {f1 f2n} -notexists {f2} -knownbugs {-changes} ########