chiark / gitweb /
dgit-badcommit-fixup: Do not investigate symrefs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Jan 2017 17:05:31 +0000 (17:05 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2017 22:14:03 +0000 (22:14 +0000)
Closes:#850547.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit-badcommit-fixup:
* Do not investigate symrefs.  Closes:#850547.

debian/changelog
dgit-badcommit-fixup

index efb9c5b2566b83dd12c035ca04f2e4cf6105f801..7d84c7bb8433f30627a2950420b1bbc83c723506 100644 (file)
@@ -1,5 +1,8 @@
 dgit (2.17~) unstable; urgency=medium
 
+  dgit-badcommit-fixup: 
+  * Do not investigate symrefs.  Closes:#850547.
+
   Test suite:
   * Internal improvements.
   * badcommit-rewrite: Fix operation using installed version of fixup.
index 0a1ebcf61ef208a3b26f36a145ab24cfd53120a7..8b202c0ae9617883d31239f6758843122cd2ff5c 100755 (executable)
@@ -234,6 +234,17 @@ foreach my $rline (split /\n/, $refs) {
        next;
     }
     next if $refname =~ m{^refs/dgit-(?:badcommit|badfixuptest)/};
+
+    $!=0; $?=0;
+    system qw(sh -ec),
+       'exec >/dev/null git symbolic-ref -q "$1"', qw(x),
+       $refname;
+    if ($?==0) {
+       $count{symrefs_ignored}++;
+       next;
+    }
+    die "$? $!" unless $?==256;
+
     my $rewrite;
     if ($type eq 'commit') {
        $rewrite = rewrite_commit($obj);