Fossil SCM

Make addremove command to fail if unprocessed arguments (other than options) are specified. To avoid mis-use where a user could think he can specify a list of directory like with many other commands.

mgagnon 2015-05-12 10:42 trunk
Commit 975600dd599fff84c0425fe636bb15cc4a393d79
1 file changed +8
+8
--- src/add.c
+++ src/add.c
@@ -632,10 +632,18 @@
632632
}
633633
634634
/* We should be done with options.. */
635635
verify_all_options();
636636
637
+ /* Fail if unprocessed arguments are present, in case user expect the
638
+ ** addremove command to accept a list of file or directory.
639
+ */
640
+ if( g.argc>2 ){
641
+ fossil_fatal(
642
+ "%s: Can only work on the entire checkout, no arguments supported.",
643
+ g.argv[1]);
644
+ }
637645
db_must_be_within_tree();
638646
if( zCleanFlag==0 ){
639647
zCleanFlag = db_get("clean-glob", 0);
640648
}
641649
if( zIgnoreFlag==0 ){
642650
--- src/add.c
+++ src/add.c
@@ -632,10 +632,18 @@
632 }
633
634 /* We should be done with options.. */
635 verify_all_options();
636
 
 
 
 
 
 
 
 
637 db_must_be_within_tree();
638 if( zCleanFlag==0 ){
639 zCleanFlag = db_get("clean-glob", 0);
640 }
641 if( zIgnoreFlag==0 ){
642
--- src/add.c
+++ src/add.c
@@ -632,10 +632,18 @@
632 }
633
634 /* We should be done with options.. */
635 verify_all_options();
636
637 /* Fail if unprocessed arguments are present, in case user expect the
638 ** addremove command to accept a list of file or directory.
639 */
640 if( g.argc>2 ){
641 fossil_fatal(
642 "%s: Can only work on the entire checkout, no arguments supported.",
643 g.argv[1]);
644 }
645 db_must_be_within_tree();
646 if( zCleanFlag==0 ){
647 zCleanFlag = db_get("clean-glob", 0);
648 }
649 if( zIgnoreFlag==0 ){
650

Keyboard Shortcuts

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