Fossil SCM

Improved comments and extra abuse defense.

drh 2025-10-15 21:58 get-command
Commit a1f420c6c6f8087ff0db093278e3bd6979739c3fee7aa1364b803ff6aff3a13c
1 file changed +16 -1
+16 -1
--- src/checkout.c
+++ src/checkout.c
@@ -457,10 +457,14 @@
457457
** Options:
458458
** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ."
459459
** to extract into the local directory.
460460
**
461461
** -f|--force Overwrite existing files
462
+**
463
+** --list List all the files that would have been checked
464
+** out but do not actually write anything to the
465
+** filesystem.
462466
**
463467
** --sqlar ARCHIVE Store the check-out in an SQL-archive rather
464468
** than unpacking them into separate files.
465469
**
466470
** -v|--verbose Show all files as they are extracted
@@ -524,10 +528,21 @@
524528
if( bDebug ){
525529
fossil_print("dest = %s\n", zDest);
526530
}
527531
528532
/* Error checking */
533
+ if( zDest!=file_tail(zDest) ){
534
+ fossil_fatal("--dest must be a simple directory name, not a path");
535
+ }
536
+ if( zVers!=file_tail(zVers) ){
537
+ fossil_fatal("The \"fossil get\" command does not current work with"
538
+ " version names that contain \"/\". This will be fixed in"
539
+ " a future release.");
540
+ }
541
+ /* To relax the restrictions above, change the subpath URL formula below
542
+ ** to use query parameters. Ex: /sqlar?r=%t&name=%t */
543
+
529544
if( !forceFlag ){
530545
if( zSqlArchive ){
531546
if( file_isdir(zSqlArchive, ExtFILE)>0 ){
532547
fossil_fatal("file already exists: \"%s\"", zSqlArchive);
533548
}
@@ -542,11 +557,11 @@
542557
}
543558
}
544559
545560
/* Construct a subpath on the URL if necessary */
546561
if( g.url.isSsh || g.url.isFile ){
547
- g.url.subpath = mprintf("/sqlar?r=%t&name=%t.sqlar", zVers, zDest);
562
+ g.url.subpath = mprintf("/sqlar/%t/%t.sqlar", zVers, zDest);
548563
}
549564
550565
if( bDebug ){
551566
urlparse_print(0);
552567
}
553568
--- src/checkout.c
+++ src/checkout.c
@@ -457,10 +457,14 @@
457 ** Options:
458 ** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ."
459 ** to extract into the local directory.
460 **
461 ** -f|--force Overwrite existing files
 
 
 
 
462 **
463 ** --sqlar ARCHIVE Store the check-out in an SQL-archive rather
464 ** than unpacking them into separate files.
465 **
466 ** -v|--verbose Show all files as they are extracted
@@ -524,10 +528,21 @@
524 if( bDebug ){
525 fossil_print("dest = %s\n", zDest);
526 }
527
528 /* Error checking */
 
 
 
 
 
 
 
 
 
 
 
529 if( !forceFlag ){
530 if( zSqlArchive ){
531 if( file_isdir(zSqlArchive, ExtFILE)>0 ){
532 fossil_fatal("file already exists: \"%s\"", zSqlArchive);
533 }
@@ -542,11 +557,11 @@
542 }
543 }
544
545 /* Construct a subpath on the URL if necessary */
546 if( g.url.isSsh || g.url.isFile ){
547 g.url.subpath = mprintf("/sqlar?r=%t&name=%t.sqlar", zVers, zDest);
548 }
549
550 if( bDebug ){
551 urlparse_print(0);
552 }
553
--- src/checkout.c
+++ src/checkout.c
@@ -457,10 +457,14 @@
457 ** Options:
458 ** --dest DIRECTORY Extract files into DIRECTORY. Use "--dest ."
459 ** to extract into the local directory.
460 **
461 ** -f|--force Overwrite existing files
462 **
463 ** --list List all the files that would have been checked
464 ** out but do not actually write anything to the
465 ** filesystem.
466 **
467 ** --sqlar ARCHIVE Store the check-out in an SQL-archive rather
468 ** than unpacking them into separate files.
469 **
470 ** -v|--verbose Show all files as they are extracted
@@ -524,10 +528,21 @@
528 if( bDebug ){
529 fossil_print("dest = %s\n", zDest);
530 }
531
532 /* Error checking */
533 if( zDest!=file_tail(zDest) ){
534 fossil_fatal("--dest must be a simple directory name, not a path");
535 }
536 if( zVers!=file_tail(zVers) ){
537 fossil_fatal("The \"fossil get\" command does not current work with"
538 " version names that contain \"/\". This will be fixed in"
539 " a future release.");
540 }
541 /* To relax the restrictions above, change the subpath URL formula below
542 ** to use query parameters. Ex: /sqlar?r=%t&name=%t */
543
544 if( !forceFlag ){
545 if( zSqlArchive ){
546 if( file_isdir(zSqlArchive, ExtFILE)>0 ){
547 fossil_fatal("file already exists: \"%s\"", zSqlArchive);
548 }
@@ -542,11 +557,11 @@
557 }
558 }
559
560 /* Construct a subpath on the URL if necessary */
561 if( g.url.isSsh || g.url.isFile ){
562 g.url.subpath = mprintf("/sqlar/%t/%t.sqlar", zVers, zDest);
563 }
564
565 if( bDebug ){
566 urlparse_print(0);
567 }
568

Keyboard Shortcuts

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