]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/builtin-add-i-cmds' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 Mar 2020 22:02:20 +0000 (15:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Mar 2020 22:02:20 +0000 (15:02 -0700)
Minor bugfixes to "git add -i" that has recently been rewritten in C.

* js/builtin-add-i-cmds:
  built-in add -i: accept open-ended ranges again
  built-in add -i: do not try to `patch`/`diff` an empty list of files

1  2 
add-interactive.c
t/t3701-add-interactive.sh

index 6a5048c83e4d6f08ae3ecfdb6beab125cde10a05,396066e7246da7ddb0284f1f953104cfc04a593d..143e6947242115d75c2225c6771455111349cea7
@@@ -913,10 -918,11 +916,10 @@@ static int run_patch(struct add_i_stat
  
        opts->prompt = N_("Patch update");
        count = list_and_choose(s, files, opts);
-       if (count >= 0) {
+       if (count > 0) {
                struct argv_array args = ARGV_ARRAY_INIT;
 +              struct pathspec ps_selected = { 0 };
  
 -              argv_array_pushl(&args, "git", "add--interactive", "--patch",
 -                               "--", NULL);
                for (i = 0; i < files->items.nr; i++)
                        if (files->selected[i])
                                argv_array_push(&args,
Simple merge