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.
Commit
975600dd599fff84c0425fe636bb15cc4a393d79
Parent
8ab3f62090095da…
1 file changed
+8
+8
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -632,10 +632,18 @@ | ||
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | /* We should be done with options.. */ |
| 635 | 635 | verify_all_options(); |
| 636 | 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 | + } | |
| 637 | 645 | db_must_be_within_tree(); |
| 638 | 646 | if( zCleanFlag==0 ){ |
| 639 | 647 | zCleanFlag = db_get("clean-glob", 0); |
| 640 | 648 | } |
| 641 | 649 | if( zIgnoreFlag==0 ){ |
| 642 | 650 |
| --- 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 |