]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-edit
edit: propagate correct editor exit code
[public-inbox.git] / script / public-inbox-edit
index 6884fd0cb276623f64f4e27b7cb5e965c4140256..24b7ed8b2d220bb7a1bc090c7228e2a7fb608e21 100755 (executable)
@@ -65,7 +65,7 @@ sub find_mid ($) {
 
 sub show_cmd ($$) {
        my ($ibx, $smsg) = @_;
-       " GIT_DIR=$ibx->{mainrepo}/all.git \\\n    git show $smsg->{blob}\n";
+       " GIT_DIR=$ibx->{inboxdir}/all.git \\\n    git show $smsg->{blob}\n";
 }
 
 sub show_found () {
@@ -149,7 +149,11 @@ retry_edit:
                        chomp(my $op = <STDIN> || '');
                        $op = lc($op);
                        goto retry_edit if $op eq 'r';
-                       exit $? if $op eq 'q';
+                       if ($op eq 'q') {
+                               # n.b. we'll lose the exit signal, here,
+                               # oh well; "q" is user-specified anyways.
+                               exit($? >> 8);
+                       }
                        last if $op eq 'c'; # continuing
                        print STDERR "\`$op' not recognized\n";
                }