Fossil SCM
Remove access check from [fossil add] to make it match [fossil addremove] which waits until [fossil commit] to check for readability. This makes it possible to use [fossil add] to add symlinks to nonexistent files and (not like this is useful) to add zero-length files for which the user does not have read permission. [fossil addremove] has always had these capabilities, but it has the drawback of adding and removing everything it can, not allowing the user to limit its scope.
Commit
46675ed219ff5e563255cc8803130ec640bd80c9
Parent
f7f6ea818a67620…
1 file changed
-2
-2
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -317,12 +317,10 @@ | ||
| 317 | 317 | isDir = file_wd_isdir(zName); |
| 318 | 318 | if( isDir==1 ){ |
| 319 | 319 | vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore); |
| 320 | 320 | }else if( isDir==0 ){ |
| 321 | 321 | fossil_warning("not found: %s", zName); |
| 322 | - }else if( file_access(zName, R_OK) ){ | |
| 323 | - fossil_fatal("cannot open %s", zName); | |
| 324 | 322 | }else{ |
| 325 | 323 | char *zTreeName = &zName[nRoot]; |
| 326 | 324 | if( !forceFlag && glob_match(pIgnore, zTreeName) ){ |
| 327 | 325 | Blob ans; |
| 328 | 326 | char cReply; |
| 329 | 327 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -317,12 +317,10 @@ | |
| 317 | isDir = file_wd_isdir(zName); |
| 318 | if( isDir==1 ){ |
| 319 | vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore); |
| 320 | }else if( isDir==0 ){ |
| 321 | fossil_warning("not found: %s", zName); |
| 322 | }else if( file_access(zName, R_OK) ){ |
| 323 | fossil_fatal("cannot open %s", zName); |
| 324 | }else{ |
| 325 | char *zTreeName = &zName[nRoot]; |
| 326 | if( !forceFlag && glob_match(pIgnore, zTreeName) ){ |
| 327 | Blob ans; |
| 328 | char cReply; |
| 329 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -317,12 +317,10 @@ | |
| 317 | isDir = file_wd_isdir(zName); |
| 318 | if( isDir==1 ){ |
| 319 | vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore); |
| 320 | }else if( isDir==0 ){ |
| 321 | fossil_warning("not found: %s", zName); |
| 322 | }else{ |
| 323 | char *zTreeName = &zName[nRoot]; |
| 324 | if( !forceFlag && glob_match(pIgnore, zTreeName) ){ |
| 325 | Blob ans; |
| 326 | char cReply; |
| 327 |