Fossil SCM
Alternative fix for ticket [711d04b6d8577].
Commit
94e2deef6d6fa4fef085a9ff7cfe1ed1762eb1cb
Parent
eab9f88e7f6c173…
1 file changed
+9
-11
+9
-11
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1087,21 +1087,19 @@ | ||
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | /* If none of the files that were named on the command line have |
| 1090 | 1090 | ** been modified, bail out now unless the --force flag is used. |
| 1091 | 1091 | */ |
| 1092 | - if( g.aCommitFile && !forceFlag ){ | |
| 1093 | - Blob modified; | |
| 1094 | - memset(&modified, 0, sizeof(Blob)); | |
| 1095 | - blob_init(&modified, 0, 0); | |
| 1096 | - db_blob(&modified, | |
| 1097 | - "SELECT pathname FROM vfile" | |
| 1098 | - " WHERE chnged = 1 AND origname IS NULL AND is_selected(id)" | |
| 1099 | - ); | |
| 1100 | - if( strlen(blob_str(&modified))==0 ){ | |
| 1101 | - fossil_fatal("none of the selected files have changed, use -f or --force.", blob_str(&modified)); | |
| 1102 | - } | |
| 1092 | + if( g.aCommitFile | |
| 1093 | + && !forceFlag | |
| 1094 | + && !db_exists( | |
| 1095 | + "SELECT 1 FROM vfile " | |
| 1096 | + " WHERE is_selected(id)" | |
| 1097 | + " AND (chnged OR deleted OR rid=0 OR pathname!=origname)") | |
| 1098 | + ){ | |
| 1099 | + fossil_fatal("none of the selected files have changed; use -f" | |
| 1100 | + " or --force."); | |
| 1103 | 1101 | } |
| 1104 | 1102 | |
| 1105 | 1103 | /* |
| 1106 | 1104 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1107 | 1105 | ** is used or unless this is a private check-in. |
| 1108 | 1106 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1087,21 +1087,19 @@ | |
| 1087 | } |
| 1088 | |
| 1089 | /* If none of the files that were named on the command line have |
| 1090 | ** been modified, bail out now unless the --force flag is used. |
| 1091 | */ |
| 1092 | if( g.aCommitFile && !forceFlag ){ |
| 1093 | Blob modified; |
| 1094 | memset(&modified, 0, sizeof(Blob)); |
| 1095 | blob_init(&modified, 0, 0); |
| 1096 | db_blob(&modified, |
| 1097 | "SELECT pathname FROM vfile" |
| 1098 | " WHERE chnged = 1 AND origname IS NULL AND is_selected(id)" |
| 1099 | ); |
| 1100 | if( strlen(blob_str(&modified))==0 ){ |
| 1101 | fossil_fatal("none of the selected files have changed, use -f or --force.", blob_str(&modified)); |
| 1102 | } |
| 1103 | } |
| 1104 | |
| 1105 | /* |
| 1106 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1107 | ** is used or unless this is a private check-in. |
| 1108 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1087,21 +1087,19 @@ | |
| 1087 | } |
| 1088 | |
| 1089 | /* If none of the files that were named on the command line have |
| 1090 | ** been modified, bail out now unless the --force flag is used. |
| 1091 | */ |
| 1092 | if( g.aCommitFile |
| 1093 | && !forceFlag |
| 1094 | && !db_exists( |
| 1095 | "SELECT 1 FROM vfile " |
| 1096 | " WHERE is_selected(id)" |
| 1097 | " AND (chnged OR deleted OR rid=0 OR pathname!=origname)") |
| 1098 | ){ |
| 1099 | fossil_fatal("none of the selected files have changed; use -f" |
| 1100 | " or --force."); |
| 1101 | } |
| 1102 | |
| 1103 | /* |
| 1104 | ** Do not allow a commit that will cause a fork unless the --force flag |
| 1105 | ** is used or unless this is a private check-in. |
| 1106 |