Fossil SCM
Add the --symlink option to test-file-environment.
Commit
e583068713164db0ffcdb8436004125eae3cb38b0f26a9fc64bd41cdb8640444
Parent
02bfb9b6294cc4e…
1 file changed
+6
+6
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1030,18 +1030,24 @@ | ||
| 1030 | 1030 | ** Options: |
| 1031 | 1031 | ** |
| 1032 | 1032 | ** --open-config Open the configuration database first. |
| 1033 | 1033 | ** --slash Trailing slashes, if any, are retained. |
| 1034 | 1034 | ** --reset Reset cached stat() info for each file. |
| 1035 | +** --symlinks BOOLEAN Force allow-symlinks on or off | |
| 1035 | 1036 | */ |
| 1036 | 1037 | void cmd_test_file_environment(void){ |
| 1037 | 1038 | int i; |
| 1038 | 1039 | int slashFlag = find_option("slash",0,0)!=0; |
| 1039 | 1040 | int resetFlag = find_option("reset",0,0)!=0; |
| 1041 | + const char *forceSymlinks = find_option("symlinks",0,1); | |
| 1040 | 1042 | if( find_option("open-config", 0, 0)!=0 ){ |
| 1041 | 1043 | Th_OpenConfig(1); |
| 1042 | 1044 | } |
| 1045 | + if( forceSymlinks ){ | |
| 1046 | + if( is_truth(forceSymlinks) ) g.allowSymlinks = 1; | |
| 1047 | + if( is_false(forceSymlinks) ) g.allowSymlinks = 0; | |
| 1048 | + } | |
| 1043 | 1049 | fossil_print("Th_IsLocalOpen() = %d\n", Th_IsLocalOpen()); |
| 1044 | 1050 | fossil_print("Th_IsRepositoryOpen() = %d\n", Th_IsRepositoryOpen()); |
| 1045 | 1051 | fossil_print("Th_IsConfigOpen() = %d\n", Th_IsConfigOpen()); |
| 1046 | 1052 | fossil_print("filenames_are_case_sensitive() = %d\n", |
| 1047 | 1053 | filenames_are_case_sensitive()); |
| 1048 | 1054 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1030,18 +1030,24 @@ | |
| 1030 | ** Options: |
| 1031 | ** |
| 1032 | ** --open-config Open the configuration database first. |
| 1033 | ** --slash Trailing slashes, if any, are retained. |
| 1034 | ** --reset Reset cached stat() info for each file. |
| 1035 | */ |
| 1036 | void cmd_test_file_environment(void){ |
| 1037 | int i; |
| 1038 | int slashFlag = find_option("slash",0,0)!=0; |
| 1039 | int resetFlag = find_option("reset",0,0)!=0; |
| 1040 | if( find_option("open-config", 0, 0)!=0 ){ |
| 1041 | Th_OpenConfig(1); |
| 1042 | } |
| 1043 | fossil_print("Th_IsLocalOpen() = %d\n", Th_IsLocalOpen()); |
| 1044 | fossil_print("Th_IsRepositoryOpen() = %d\n", Th_IsRepositoryOpen()); |
| 1045 | fossil_print("Th_IsConfigOpen() = %d\n", Th_IsConfigOpen()); |
| 1046 | fossil_print("filenames_are_case_sensitive() = %d\n", |
| 1047 | filenames_are_case_sensitive()); |
| 1048 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1030,18 +1030,24 @@ | |
| 1030 | ** Options: |
| 1031 | ** |
| 1032 | ** --open-config Open the configuration database first. |
| 1033 | ** --slash Trailing slashes, if any, are retained. |
| 1034 | ** --reset Reset cached stat() info for each file. |
| 1035 | ** --symlinks BOOLEAN Force allow-symlinks on or off |
| 1036 | */ |
| 1037 | void cmd_test_file_environment(void){ |
| 1038 | int i; |
| 1039 | int slashFlag = find_option("slash",0,0)!=0; |
| 1040 | int resetFlag = find_option("reset",0,0)!=0; |
| 1041 | const char *forceSymlinks = find_option("symlinks",0,1); |
| 1042 | if( find_option("open-config", 0, 0)!=0 ){ |
| 1043 | Th_OpenConfig(1); |
| 1044 | } |
| 1045 | if( forceSymlinks ){ |
| 1046 | if( is_truth(forceSymlinks) ) g.allowSymlinks = 1; |
| 1047 | if( is_false(forceSymlinks) ) g.allowSymlinks = 0; |
| 1048 | } |
| 1049 | fossil_print("Th_IsLocalOpen() = %d\n", Th_IsLocalOpen()); |
| 1050 | fossil_print("Th_IsRepositoryOpen() = %d\n", Th_IsRepositoryOpen()); |
| 1051 | fossil_print("Th_IsConfigOpen() = %d\n", Th_IsConfigOpen()); |
| 1052 | fossil_print("filenames_are_case_sensitive() = %d\n", |
| 1053 | filenames_are_case_sensitive()); |
| 1054 |