Fossil SCM
Fix the locate_unmanaged_files() routine so that it always see (and ignores) symbolic links.
Commit
0938b56516d1536314133c1756de249b08432d24da391b91786a9cd375a65525
Parent
f7f31147deaecee…
1 file changed
+6
-3
+6
-3
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -62,10 +62,13 @@ | ||
| 62 | 62 | ** Create a TEMP table named SFILE and add all unmanaged files named on |
| 63 | 63 | ** the command-line to that table. If directories are named, then add |
| 64 | 64 | ** all unmanaged files contained underneath those directories. If there |
| 65 | 65 | ** are no files or directories named on the command-line, then add all |
| 66 | 66 | ** unmanaged files anywhere in the checkout. |
| 67 | +** | |
| 68 | +** This routine never follows symlinks. It always treats symlinks as | |
| 69 | +** object unto themselves. | |
| 67 | 70 | */ |
| 68 | 71 | static void locate_unmanaged_files( |
| 69 | 72 | int argc, /* Number of command-line arguments to examine */ |
| 70 | 73 | char **argv, /* values of command-line arguments */ |
| 71 | 74 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| @@ -80,19 +83,19 @@ | ||
| 80 | 83 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s," |
| 81 | 84 | " mtime INTEGER, size INTEGER)", filename_collation()); |
| 82 | 85 | nRoot = (int)strlen(g.zLocalRoot); |
| 83 | 86 | if( argc==0 ){ |
| 84 | 87 | blob_init(&name, g.zLocalRoot, nRoot - 1); |
| 85 | - vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0, RepoFILE); | |
| 88 | + vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0, SymFILE); | |
| 86 | 89 | blob_reset(&name); |
| 87 | 90 | }else{ |
| 88 | 91 | for(i=0; i<argc; i++){ |
| 89 | 92 | file_canonical_name(argv[i], &name, 0); |
| 90 | 93 | zName = blob_str(&name); |
| 91 | - isDir = file_isdir(zName, RepoFILE); | |
| 94 | + isDir = file_isdir(zName, SymFILE); | |
| 92 | 95 | if( isDir==1 ){ |
| 93 | - vfile_scan(&name, nRoot-1, scanFlags, pIgnore, 0, RepoFILE); | |
| 96 | + vfile_scan(&name, nRoot-1, scanFlags, pIgnore, 0, SymFILE); | |
| 94 | 97 | }else if( isDir==0 ){ |
| 95 | 98 | fossil_warning("not found: %s", &zName[nRoot]); |
| 96 | 99 | }else if( file_access(zName, R_OK) ){ |
| 97 | 100 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 98 | 101 | }else{ |
| 99 | 102 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -62,10 +62,13 @@ | |
| 62 | ** Create a TEMP table named SFILE and add all unmanaged files named on |
| 63 | ** the command-line to that table. If directories are named, then add |
| 64 | ** all unmanaged files contained underneath those directories. If there |
| 65 | ** are no files or directories named on the command-line, then add all |
| 66 | ** unmanaged files anywhere in the checkout. |
| 67 | */ |
| 68 | static void locate_unmanaged_files( |
| 69 | int argc, /* Number of command-line arguments to examine */ |
| 70 | char **argv, /* values of command-line arguments */ |
| 71 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| @@ -80,19 +83,19 @@ | |
| 80 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s," |
| 81 | " mtime INTEGER, size INTEGER)", filename_collation()); |
| 82 | nRoot = (int)strlen(g.zLocalRoot); |
| 83 | if( argc==0 ){ |
| 84 | blob_init(&name, g.zLocalRoot, nRoot - 1); |
| 85 | vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0, RepoFILE); |
| 86 | blob_reset(&name); |
| 87 | }else{ |
| 88 | for(i=0; i<argc; i++){ |
| 89 | file_canonical_name(argv[i], &name, 0); |
| 90 | zName = blob_str(&name); |
| 91 | isDir = file_isdir(zName, RepoFILE); |
| 92 | if( isDir==1 ){ |
| 93 | vfile_scan(&name, nRoot-1, scanFlags, pIgnore, 0, RepoFILE); |
| 94 | }else if( isDir==0 ){ |
| 95 | fossil_warning("not found: %s", &zName[nRoot]); |
| 96 | }else if( file_access(zName, R_OK) ){ |
| 97 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 98 | }else{ |
| 99 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -62,10 +62,13 @@ | |
| 62 | ** Create a TEMP table named SFILE and add all unmanaged files named on |
| 63 | ** the command-line to that table. If directories are named, then add |
| 64 | ** all unmanaged files contained underneath those directories. If there |
| 65 | ** are no files or directories named on the command-line, then add all |
| 66 | ** unmanaged files anywhere in the checkout. |
| 67 | ** |
| 68 | ** This routine never follows symlinks. It always treats symlinks as |
| 69 | ** object unto themselves. |
| 70 | */ |
| 71 | static void locate_unmanaged_files( |
| 72 | int argc, /* Number of command-line arguments to examine */ |
| 73 | char **argv, /* values of command-line arguments */ |
| 74 | unsigned scanFlags, /* Zero or more SCAN_xxx flags */ |
| @@ -80,19 +83,19 @@ | |
| 83 | db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s," |
| 84 | " mtime INTEGER, size INTEGER)", filename_collation()); |
| 85 | nRoot = (int)strlen(g.zLocalRoot); |
| 86 | if( argc==0 ){ |
| 87 | blob_init(&name, g.zLocalRoot, nRoot - 1); |
| 88 | vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0, SymFILE); |
| 89 | blob_reset(&name); |
| 90 | }else{ |
| 91 | for(i=0; i<argc; i++){ |
| 92 | file_canonical_name(argv[i], &name, 0); |
| 93 | zName = blob_str(&name); |
| 94 | isDir = file_isdir(zName, SymFILE); |
| 95 | if( isDir==1 ){ |
| 96 | vfile_scan(&name, nRoot-1, scanFlags, pIgnore, 0, SymFILE); |
| 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 |