chiark / gitweb /
git-debrebase: classify: introduce $prevbrw (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 25 Aug 2017 09:44:04 +0000 (10:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 11:25:49 +0000 (12:25 +0100)
git-debrebase

index b2c15d6..a3733a9 100755 (executable)
@@ -398,13 +398,16 @@ sub classify ($) {
     # debian/) so debian breakwater branch should be 1st parent; that
     # way also there's also an easy rune to look for the upstream
     # patches (--topo-order).
+
+    my $prevbrw = 0;
+
     if (@p == 2 &&
        !$haspatches &&
-       !$p[0]{IsOrigin} && # breakwater merge never starts with an origin
-       !($p[0]{Differs} & ~D_DEB) &&
-       !($p[1]{Differs} & ~D_UPS)) {
+       !$p[$prevbrw]{IsOrigin} && # breakwater never starts with an origin
+       !($p[$prevbrw]{Differs} & ~D_DEB) &&
+       !($p[!$prevbrw]{Differs} & ~D_UPS)) {
        return $classify->(qw(BreakwaterUpstreamMerge),
-                          OrigParents => [ $p[1] ]);
+                          OrigParents => [ $p[!$prevbrw] ]);
     }
     # xxx multi-.orig upstreams