Index: src/checkin.c ================================================================== --- src/checkin.c +++ src/checkin.c @@ -1084,24 +1084,22 @@ db_record_repository_filename(0); if( hasChanges==0 && !isAMerge && !forceFlag ){ fossil_fatal("nothing has changed"); } - /* If one or more files that were named on the command line have not - ** been modified, bail out now. + /* If none of the files that were named on the command line have + ** been modified, bail out now unless the --force flag is used. */ - if( g.aCommitFile ){ - Blob unmodified; - memset(&unmodified, 0, sizeof(Blob)); - blob_init(&unmodified, 0, 0); - db_blob(&unmodified, - "SELECT pathname FROM vfile" - " WHERE chnged = 0 AND origname IS NULL AND is_selected(id)" - ); - if( strlen(blob_str(&unmodified)) ){ - fossil_fatal("file %s has not changed", blob_str(&unmodified)); - } + if( g.aCommitFile + && !forceFlag + && !db_exists( + "SELECT 1 FROM vfile " + " WHERE is_selected(id)" + " AND (chnged OR deleted OR rid=0 OR pathname!=origname)") + ){ + fossil_fatal("none of the selected files have changed; use -f" + " or --force."); } /* ** Do not allow a commit that will cause a fork unless the --force flag ** is used or unless this is a private check-in.