Fossil SCM

fix specified file path case in locate_unmanaged_files() Only insert unmanaged files into the temp sfile table. This now makes the routine behave consistently whether file, directory, or no paths are passed on the command line, and fixes the `fossil changes --extra` bug report in [forum:452ec8fac167].

mark 2022-09-25 14:18 trunk
Commit 39eb451ad3326a65ff3f6e1638909213d3e833f2bf5615881ce64a99afc2a397
1 file changed +5 -2
+5 -2
--- src/checkin.c
+++ src/checkin.c
@@ -97,13 +97,16 @@
9797
}else if( isDir==0 ){
9898
fossil_warning("not found: %s", &zName[nRoot]);
9999
}else if( file_access(zName, R_OK) ){
100100
fossil_fatal("cannot open %s", &zName[nRoot]);
101101
}else{
102
+ /* Only add unmanaged file paths specified on the command line. */
102103
db_multi_exec(
103
- "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
104
- &zName[nRoot]
104
+ "INSERT OR IGNORE INTO sfile(pathname)"
105
+ " SELECT %Q WHERE NOT EXISTS"
106
+ " (SELECT 1 FROM vfile WHERE pathname=%Q)",
107
+ &zName[nRoot], &zName[nRoot]
105108
);
106109
}
107110
blob_reset(&name);
108111
}
109112
}
110113
--- src/checkin.c
+++ src/checkin.c
@@ -97,13 +97,16 @@
97 }else if( isDir==0 ){
98 fossil_warning("not found: %s", &zName[nRoot]);
99 }else if( file_access(zName, R_OK) ){
100 fossil_fatal("cannot open %s", &zName[nRoot]);
101 }else{
 
102 db_multi_exec(
103 "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)",
104 &zName[nRoot]
 
 
105 );
106 }
107 blob_reset(&name);
108 }
109 }
110
--- src/checkin.c
+++ src/checkin.c
@@ -97,13 +97,16 @@
97 }else if( isDir==0 ){
98 fossil_warning("not found: %s", &zName[nRoot]);
99 }else if( file_access(zName, R_OK) ){
100 fossil_fatal("cannot open %s", &zName[nRoot]);
101 }else{
102 /* Only add unmanaged file paths specified on the command line. */
103 db_multi_exec(
104 "INSERT OR IGNORE INTO sfile(pathname)"
105 " SELECT %Q WHERE NOT EXISTS"
106 " (SELECT 1 FROM vfile WHERE pathname=%Q)",
107 &zName[nRoot], &zName[nRoot]
108 );
109 }
110 blob_reset(&name);
111 }
112 }
113

Keyboard Shortcuts

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