revision: forbid combining --graph and --no-walk
[gitweb.git] / git-add--interactive.perl
index 32c2f9cf88201b2dc2b94b9c97633c8c67d8c6c5..c7256741cc2a28f333d6a9be5f12e248df99ed5e 100755 (executable)
@@ -58,6 +58,9 @@
                Term::ReadKey->import;
                $use_readkey = 1;
        };
+       if (!$use_readkey) {
+               print STDERR "missing Term::ReadKey, disabling interactive.singlekey\n";
+       }
        eval {
                require Term::Cap;
                my $termcap = Term::Cap->Tgetent;
@@ -1353,6 +1356,7 @@ sub patch_update_file {
                  $patch_mode_flavour{TARGET},
                  " [y,n,q,a,d,/$other,?]? ";
                my $line = prompt_single_character;
+               last unless defined $line;
                if ($line) {
                        if ($line =~ /^y/i) {
                                $hunk[$ix]{USE} = 1;