Fossil SCM

Use the preferred case for the destination name in the "fossil mv" command.

drh 2024-04-27 10:45 trunk
Commit 859b00b77698c436a2ccd5a9338ec2c7332e37ae067510396e3088b966213e64
1 file changed +2 -1
+2 -1
--- src/add.c
+++ src/add.c
@@ -1057,11 +1057,11 @@
10571057
fossil_fatal("no check-out in which to rename files");
10581058
}
10591059
if( g.argc<4 ){
10601060
usage("OLDNAME NEWNAME");
10611061
}
1062
- zDest = g.argv[g.argc-1];
1062
+ zDest = file_case_preferred_name(".",g.argv[g.argc-1]);
10631063
db_begin_transaction();
10641064
if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
10651065
moveFiles = 0;
10661066
}else if( softFlag ){
10671067
moveFiles = 0;
@@ -1143,14 +1143,15 @@
11431143
}
11441144
db_finalize(&q);
11451145
undo_reset();
11461146
db_end_transaction(0);
11471147
if( moveFiles ) process_files_to_move(dryRunFlag);
1148
+ fossil_free(zDest);
11481149
}
11491150
11501151
/*
11511152
** Function for stash_apply to be able to restore a file and indicate
11521153
** newly ADDED state.
11531154
*/
11541155
int stash_add_files_in_sfile(int vid){
11551156
return add_files_in_sfile(vid);
11561157
}
11571158
--- src/add.c
+++ src/add.c
@@ -1057,11 +1057,11 @@
1057 fossil_fatal("no check-out in which to rename files");
1058 }
1059 if( g.argc<4 ){
1060 usage("OLDNAME NEWNAME");
1061 }
1062 zDest = g.argv[g.argc-1];
1063 db_begin_transaction();
1064 if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
1065 moveFiles = 0;
1066 }else if( softFlag ){
1067 moveFiles = 0;
@@ -1143,14 +1143,15 @@
1143 }
1144 db_finalize(&q);
1145 undo_reset();
1146 db_end_transaction(0);
1147 if( moveFiles ) process_files_to_move(dryRunFlag);
 
1148 }
1149
1150 /*
1151 ** Function for stash_apply to be able to restore a file and indicate
1152 ** newly ADDED state.
1153 */
1154 int stash_add_files_in_sfile(int vid){
1155 return add_files_in_sfile(vid);
1156 }
1157
--- src/add.c
+++ src/add.c
@@ -1057,11 +1057,11 @@
1057 fossil_fatal("no check-out in which to rename files");
1058 }
1059 if( g.argc<4 ){
1060 usage("OLDNAME NEWNAME");
1061 }
1062 zDest = file_case_preferred_name(".",g.argv[g.argc-1]);
1063 db_begin_transaction();
1064 if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
1065 moveFiles = 0;
1066 }else if( softFlag ){
1067 moveFiles = 0;
@@ -1143,14 +1143,15 @@
1143 }
1144 db_finalize(&q);
1145 undo_reset();
1146 db_end_transaction(0);
1147 if( moveFiles ) process_files_to_move(dryRunFlag);
1148 fossil_free(zDest);
1149 }
1150
1151 /*
1152 ** Function for stash_apply to be able to restore a file and indicate
1153 ** newly ADDED state.
1154 */
1155 int stash_add_files_in_sfile(int vid){
1156 return add_files_in_sfile(vid);
1157 }
1158

Keyboard Shortcuts

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