[PATCH 2/4] Teach git-add--interactive to accept multiple file params
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Nov 22, 2007, 00:02 UTC
- Message-ID
- <1195689773-28601-3-git-send-email-win@wincent.com>
- In-Reply-To
- <1195689773-28601-2-git-send-email-win@wincent.com>
As per Jeff King's suggestion, this commit teaches git-add--interactive to accept multiple optional file parameters, which will be fed into the "patch" subcommand one by one. After all parameters are processed we drop back into the standard command loop.
Signed-off-by: Wincent Colaiuta <win@wincent.com> --- git-add--interactive.perl | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 95e537c..2bba07d 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -805,10 +805,9 @@ sub main_loop { } } -die "add --interactive may take only 1 optional parameter" if ($#ARGV > 0); refresh(); -if ($#ARGV == 0) { - patch_update_file($ARGV[0]); +foreach my $file (@ARGV) { + patch_update_file($file); } status_cmd(); main_loop();
-- 1.5.3.6.867.g539b6-dirty