summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-05 17:42:01 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-05 17:42:01 +0000
commit9b732efaa8ab19d050c3bb208a4d2c337922ce91 (patch)
treea7a27c6f78730fcb3390a03b44359a7d9529147e
parent270c257f81665d1bcfab1ca4a3d831b5bcabc034 (diff)
badcommit-fixup: break out $bare
-rwxr-xr-xbadcommit-fixup7
1 files changed, 4 insertions, 3 deletions
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 "$! $?";