chiark / gitweb /
git-debrebase: merge: Miscellaneous mwrecknote fixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 16:58:57 +0000 (17:58 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 19:10:12 +0000 (20:10 +0100)
Add the missing commitish for the -patchqueue wrecknote.

Defend against undef (or too few) args to mwrecknote.
(The way we end up calling it means perl doesn't notice.)

In walk, ensure that we initialise $cl->{MergeWreckNotes}.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase

index 37982499351e8365da2ef022c71f9abff5873b29..563fb9970fa4f7bb8f7ac46c4d7b583e8d68f36a 100755 (executable)
@@ -370,6 +370,7 @@ sub gbp_pq_export ($$$) {
 
 sub mwrecknote ($$$) {
     my ($wrecknotes, $reftail, $commitish) = @_;
+    confess unless defined $commitish;
     $wrecknotes->{$reftail} = $commitish;
 }
 
@@ -454,7 +455,7 @@ sub merge_series ($$$;@) {
            printdebug "pec' $pec\n";
             runcmd @git, qw(reset -q --hard), $pec;
            $q->{MR}{PEC} = $pec;
-           $mwrecknote->("$q->{LeftRight}-patchqueue");
+           $mwrecknote->("$q->{LeftRight}-patchqueue", $pec);
        }
        # now, because of reverse, we are on $input_q->{MR}{OQC}
        runcmd @git, qw(checkout -q -b merge);
@@ -1053,6 +1054,7 @@ sub walk ($;$$$) {
 
     for (;;) {
        $cl = classify $cur;
+       $cl->{MergeWreckNotes} //= {};
        my $ty = $cl->{Type};
        my $st = $cl->{SubType};
        $prline->("$cl->{CommitId} $cl->{Type}");