Fossil SCM
Same optimization in "fossil reconstruct"
Commit
e1bcc99da3684574332b489b9defc142a8d36a0e
Parent
eb2dc8faac5fe97…
2 files changed
+1
-1
+4
-4
+1
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -858,11 +858,11 @@ | ||
| 858 | 858 | continue; |
| 859 | 859 | } |
| 860 | 860 | zUtf8Name = fossil_filename_to_utf8(pEntry->d_name); |
| 861 | 861 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 862 | 862 | fossil_filename_free(zUtf8Name); |
| 863 | -#ifdef XX_DIRENT_HAVE_D_TYPE | |
| 863 | +#ifdef _DIRENT_HAVE_D_TYPE | |
| 864 | 864 | if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) |
| 865 | 865 | ? (file_isdir(zSubpath)==1) : (pEntry->d_type==DT_DIR) ) |
| 866 | 866 | #else |
| 867 | 867 | if( file_isdir(zSubpath)==1 ) |
| 868 | 868 | #endif |
| 869 | 869 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -858,11 +858,11 @@ | |
| 858 | continue; |
| 859 | } |
| 860 | zUtf8Name = fossil_filename_to_utf8(pEntry->d_name); |
| 861 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 862 | fossil_filename_free(zUtf8Name); |
| 863 | #ifdef XX_DIRENT_HAVE_D_TYPE |
| 864 | if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) |
| 865 | ? (file_isdir(zSubpath)==1) : (pEntry->d_type==DT_DIR) ) |
| 866 | #else |
| 867 | if( file_isdir(zSubpath)==1 ) |
| 868 | #endif |
| 869 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -858,11 +858,11 @@ | |
| 858 | continue; |
| 859 | } |
| 860 | zUtf8Name = fossil_filename_to_utf8(pEntry->d_name); |
| 861 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 862 | fossil_filename_free(zUtf8Name); |
| 863 | #ifdef _DIRENT_HAVE_D_TYPE |
| 864 | if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) |
| 865 | ? (file_isdir(zSubpath)==1) : (pEntry->d_type==DT_DIR) ) |
| 866 | #else |
| 867 | if( file_isdir(zSubpath)==1 ) |
| 868 | #endif |
| 869 |
+4
-4
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -487,21 +487,21 @@ | ||
| 487 | 487 | zPath = blob_str(pPath); |
| 488 | 488 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 489 | 489 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 490 | 490 | /* do nothing */ |
| 491 | 491 | #ifdef _DIRENT_HAVE_D_TYPE |
| 492 | - }else if( (pEntry->d_type==DT_UNKNOWN) ? (file_wd_isdir(zPath)==1) | |
| 493 | - : (pEntry->d_type==DT_DIR) ){ | |
| 492 | + }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) | |
| 493 | + ? (file_wd_isdir(zPath)==1) : (pEntry->d_type==DT_DIR) ){ | |
| 494 | 494 | #else |
| 495 | 495 | }else if( file_wd_isdir(zPath)==1 ){ |
| 496 | 496 | #endif |
| 497 | 497 | if( !vfile_top_of_checkout(zPath) ){ |
| 498 | 498 | vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); |
| 499 | 499 | } |
| 500 | 500 | #ifdef _DIRENT_HAVE_D_TYPE |
| 501 | - }else if( (pEntry->d_type==DT_UNKNOWN) ? (file_wd_isfile_or_link(zPath)) | |
| 502 | - : (pEntry->d_type==DT_REG||pEntry->d_type==DT_LNK) ){ | |
| 501 | + }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) | |
| 502 | + ? (file_wd_isfile_or_link(zPath)) : (pEntry->d_type==DT_REG) ){ | |
| 503 | 503 | #else |
| 504 | 504 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 505 | 505 | #endif |
| 506 | 506 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 507 | 507 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 508 | 508 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -487,21 +487,21 @@ | |
| 487 | zPath = blob_str(pPath); |
| 488 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 489 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 490 | /* do nothing */ |
| 491 | #ifdef _DIRENT_HAVE_D_TYPE |
| 492 | }else if( (pEntry->d_type==DT_UNKNOWN) ? (file_wd_isdir(zPath)==1) |
| 493 | : (pEntry->d_type==DT_DIR) ){ |
| 494 | #else |
| 495 | }else if( file_wd_isdir(zPath)==1 ){ |
| 496 | #endif |
| 497 | if( !vfile_top_of_checkout(zPath) ){ |
| 498 | vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); |
| 499 | } |
| 500 | #ifdef _DIRENT_HAVE_D_TYPE |
| 501 | }else if( (pEntry->d_type==DT_UNKNOWN) ? (file_wd_isfile_or_link(zPath)) |
| 502 | : (pEntry->d_type==DT_REG||pEntry->d_type==DT_LNK) ){ |
| 503 | #else |
| 504 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 505 | #endif |
| 506 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 507 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 508 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -487,21 +487,21 @@ | |
| 487 | zPath = blob_str(pPath); |
| 488 | if( glob_match(pIgnore1, &zPath[nPrefix+1]) || |
| 489 | glob_match(pIgnore2, &zPath[nPrefix+1]) ){ |
| 490 | /* do nothing */ |
| 491 | #ifdef _DIRENT_HAVE_D_TYPE |
| 492 | }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) |
| 493 | ? (file_wd_isdir(zPath)==1) : (pEntry->d_type==DT_DIR) ){ |
| 494 | #else |
| 495 | }else if( file_wd_isdir(zPath)==1 ){ |
| 496 | #endif |
| 497 | if( !vfile_top_of_checkout(zPath) ){ |
| 498 | vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); |
| 499 | } |
| 500 | #ifdef _DIRENT_HAVE_D_TYPE |
| 501 | }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) |
| 502 | ? (file_wd_isfile_or_link(zPath)) : (pEntry->d_type==DT_REG) ){ |
| 503 | #else |
| 504 | }else if( file_wd_isfile_or_link(zPath) ){ |
| 505 | #endif |
| 506 | if( (scanFlags & SCAN_TEMP)==0 || is_temporary_file(zUtf8) ){ |
| 507 | db_bind_text(&ins, ":file", &zPath[nPrefix+1]); |
| 508 |