Fossil SCM

Alternative fix for ticket [711d04b6d8577].

drh 2012-09-27 11:51 UTC ticket-711d04b6d8
Commit 94e2deef6d6fa4fef085a9ff7cfe1ed1762eb1cb
1 file changed +9 -11
+9 -11
--- src/checkin.c
+++ src/checkin.c
@@ -1087,21 +1087,19 @@
10871087
}
10881088
10891089
/* If none of the files that were named on the command line have
10901090
** been modified, bail out now unless the --force flag is used.
10911091
*/
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.");
11031101
}
11041102
11051103
/*
11061104
** Do not allow a commit that will cause a fork unless the --force flag
11071105
** is used or unless this is a private check-in.
11081106
--- 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

Keyboard Shortcuts

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