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].
Commit
39eb451ad3326a65ff3f6e1638909213d3e833f2bf5615881ce64a99afc2a397
Parent
2a3e851e7bb88c9…
1 file changed
+5
-2
+5
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -97,13 +97,16 @@ | ||
| 97 | 97 | }else if( isDir==0 ){ |
| 98 | 98 | fossil_warning("not found: %s", &zName[nRoot]); |
| 99 | 99 | }else if( file_access(zName, R_OK) ){ |
| 100 | 100 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 101 | 101 | }else{ |
| 102 | + /* Only add unmanaged file paths specified on the command line. */ | |
| 102 | 103 | 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] | |
| 105 | 108 | ); |
| 106 | 109 | } |
| 107 | 110 | blob_reset(&name); |
| 108 | 111 | } |
| 109 | 112 | } |
| 110 | 113 |
| --- 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 |