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.

andygoth 2015-05-15 02:25 trunk
Commit 46675ed219ff5e563255cc8803130ec640bd80c9
1 file changed -2
-2
--- src/add.c
+++ src/add.c
@@ -317,12 +317,10 @@
317317
isDir = file_wd_isdir(zName);
318318
if( isDir==1 ){
319319
vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
320320
}else if( isDir==0 ){
321321
fossil_warning("not found: %s", zName);
322
- }else if( file_access(zName, R_OK) ){
323
- fossil_fatal("cannot open %s", zName);
324322
}else{
325323
char *zTreeName = &zName[nRoot];
326324
if( !forceFlag && glob_match(pIgnore, zTreeName) ){
327325
Blob ans;
328326
char cReply;
329327
--- 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

Keyboard Shortcuts

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