Fossil SCM
When case-sensitive is off, refuse a commit that includes a pathname that differs only in case from another pathname, since both names are one file on disk and the commit would record its content under both.
Commit
30ed2b9377c851c17427c82e0d65ab5f9d443e4e0f959007c41355e0a6351723
Parent
53228924e443e73…
1 file changed
+11
+11
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2868,10 +2868,21 @@ | ||
| 2868 | 2868 | fossil_fatal("cannot do a partial commit of '%s' without '%s' because " |
| 2869 | 2869 | "'%s' was renamed to '%s'", zFrom, zTo, zFrom, zTo); |
| 2870 | 2870 | } |
| 2871 | 2871 | db_finalize(&q); |
| 2872 | 2872 | } |
| 2873 | + | |
| 2874 | + /* With case-sensitive set to off, two filenames that differ | |
| 2875 | + ** only in case are the same file on disk. Committing either | |
| 2876 | + ** file would record the content content under both filenames. | |
| 2877 | + */ | |
| 2878 | + vfile_check_case_collisions( | |
| 2879 | + "SELECT pathname FROM vfile WHERE vid=%d AND NOT deleted" | |
| 2880 | + " AND pathname %s IN (SELECT pathname FROM vfile" | |
| 2881 | + " WHERE vid=%d AND NOT deleted" | |
| 2882 | + " AND is_selected(id))", | |
| 2883 | + vid, filename_collation(), vid); | |
| 2873 | 2884 | |
| 2874 | 2885 | db_begin_transaction(); |
| 2875 | 2886 | db_record_repository_filename(0); |
| 2876 | 2887 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2877 | 2888 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2878 | 2889 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2868,10 +2868,21 @@ | |
| 2868 | fossil_fatal("cannot do a partial commit of '%s' without '%s' because " |
| 2869 | "'%s' was renamed to '%s'", zFrom, zTo, zFrom, zTo); |
| 2870 | } |
| 2871 | db_finalize(&q); |
| 2872 | } |
| 2873 | |
| 2874 | db_begin_transaction(); |
| 2875 | db_record_repository_filename(0); |
| 2876 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2877 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2878 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2868,10 +2868,21 @@ | |
| 2868 | fossil_fatal("cannot do a partial commit of '%s' without '%s' because " |
| 2869 | "'%s' was renamed to '%s'", zFrom, zTo, zFrom, zTo); |
| 2870 | } |
| 2871 | db_finalize(&q); |
| 2872 | } |
| 2873 | |
| 2874 | /* With case-sensitive set to off, two filenames that differ |
| 2875 | ** only in case are the same file on disk. Committing either |
| 2876 | ** file would record the content content under both filenames. |
| 2877 | */ |
| 2878 | vfile_check_case_collisions( |
| 2879 | "SELECT pathname FROM vfile WHERE vid=%d AND NOT deleted" |
| 2880 | " AND pathname %s IN (SELECT pathname FROM vfile" |
| 2881 | " WHERE vid=%d AND NOT deleted" |
| 2882 | " AND is_selected(id))", |
| 2883 | vid, filename_collation(), vid); |
| 2884 | |
| 2885 | db_begin_transaction(); |
| 2886 | db_record_repository_filename(0); |
| 2887 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 2888 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 2889 |