From: Ian Jackson Date: Thu, 5 Jan 2017 17:42:01 +0000 (+0000) Subject: badcommit-fixup: break out $bare X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=83fbb02c1eeb835bc9362df749241863fdda37b3;p=dgit-junk.git badcommit-fixup: break out $bare --- diff --git a/badcommit-fixup b/badcommit-fixup index ca2e0df..44c0702 100755 --- a/badcommit-fixup +++ b/badcommit-fixup @@ -138,12 +138,13 @@ foreach my $rline (split /\n/, $refs) { push @updates, [ $refname, $obj, $rewrite ]; } +$!=0; $?=0; +my $bare = `git rev-parse --is-bare-repository`; +die "$? $!" if $?; + open U, "|git update-ref -m 'dgit bad commit fixup' --stdin" or die $!; if ($real) { - $!=0; $?=0; - my $bare = `git rev-parse --is-bare-repository`; - die "$? $!" if $?; if ($bare eq 'false') { print "detaching your HEAD\n" or die $!; system 'git checkout --detach' and die "$! $?";