Fossil SCM
Remove redundancy from the "fossil rm" command, as pointed out by Carles Pagès.
Commit
7fca007538fea65f96a57974228a24691c978a22
Parent
3d2e8b2ddf99382…
1 file changed
+1
-11
+1
-11
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -368,21 +368,11 @@ | ||
| 368 | 368 | if( file_isdir(zName) == 1 ){ |
| 369 | 369 | int sz = strlen(zName); |
| 370 | 370 | if( sz>0 && zName[sz-1]=='/' ){ zName[sz-1] = 0; } |
| 371 | 371 | del_directory_content(zName); |
| 372 | 372 | } else { |
| 373 | - char *zPath; | |
| 374 | - Blob pathname; | |
| 375 | - file_tree_name(zName, &pathname, 1); | |
| 376 | - zPath = blob_str(&pathname); | |
| 377 | - if( !db_exists( | |
| 378 | - "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){ | |
| 379 | - fossil_fatal("not in the repository: %s", zName); | |
| 380 | - }else{ | |
| 381 | - delete_one_file(zPath); | |
| 382 | - } | |
| 383 | - blob_reset(&pathname); | |
| 373 | + delete_one_file(zName); | |
| 384 | 374 | } |
| 385 | 375 | free(zName); |
| 386 | 376 | } |
| 387 | 377 | db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0"); |
| 388 | 378 | db_end_transaction(0); |
| 389 | 379 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -368,21 +368,11 @@ | |
| 368 | if( file_isdir(zName) == 1 ){ |
| 369 | int sz = strlen(zName); |
| 370 | if( sz>0 && zName[sz-1]=='/' ){ zName[sz-1] = 0; } |
| 371 | del_directory_content(zName); |
| 372 | } else { |
| 373 | char *zPath; |
| 374 | Blob pathname; |
| 375 | file_tree_name(zName, &pathname, 1); |
| 376 | zPath = blob_str(&pathname); |
| 377 | if( !db_exists( |
| 378 | "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){ |
| 379 | fossil_fatal("not in the repository: %s", zName); |
| 380 | }else{ |
| 381 | delete_one_file(zPath); |
| 382 | } |
| 383 | blob_reset(&pathname); |
| 384 | } |
| 385 | free(zName); |
| 386 | } |
| 387 | db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0"); |
| 388 | db_end_transaction(0); |
| 389 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -368,21 +368,11 @@ | |
| 368 | if( file_isdir(zName) == 1 ){ |
| 369 | int sz = strlen(zName); |
| 370 | if( sz>0 && zName[sz-1]=='/' ){ zName[sz-1] = 0; } |
| 371 | del_directory_content(zName); |
| 372 | } else { |
| 373 | delete_one_file(zName); |
| 374 | } |
| 375 | free(zName); |
| 376 | } |
| 377 | db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0"); |
| 378 | db_end_transaction(0); |
| 379 |