l10n: es.po: Spanish update for v2.18.0 round 2
[gitweb.git] / git-add--interactive.perl
index 7a0c95fd0deb685a43fd3aa4bd88515ce0eb9fcd..36f38ced902e1902a626933bdcda09819acf39a7 100755 (executable)
@@ -205,8 +205,15 @@ sub list_untracked {
        }
 }
 
-sub get_empty_tree {
-       return '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
+{
+       my $empty_tree;
+       sub get_empty_tree {
+               return $empty_tree if defined $empty_tree;
+
+               $empty_tree = run_cmd_pipe(qw(git hash-object -t tree /dev/null));
+               chomp $empty_tree;
+               return $empty_tree;
+       }
 }
 
 sub get_diff_reference {
@@ -705,6 +712,14 @@ sub parse_diff {
        }
        my (@hunk) = { TEXT => [], DISPLAY => [], TYPE => 'header' };
 
+       if (@colored && @colored != @diff) {
+               print STDERR
+                 "fatal: mismatched output from interactive.diffFilter\n",
+                 "hint: Your filter must maintain a one-to-one correspondence\n",
+                 "hint: between its input and output lines.\n";
+               exit 1;
+       }
+
        for (my $i = 0; $i < @diff; $i++) {
                if ($diff[$i] =~ /^@@ /) {
                        push @hunk, { TEXT => [], DISPLAY => [],
@@ -1556,7 +1571,7 @@ sub patch_update_file {
                                        error_msg __("No other hunks to search\n");
                                        next;
                                }
-                               if ($1 eq "") {
+                               if ($regex eq "") {
                                        print colored $prompt_color, __("search for regex? ");
                                        $regex = <STDIN>;
                                        if (defined $regex) {