}
$!=0; $?=0;
-my $refs=`git-for-each-ref`;
+my $refs=`git for-each-ref`;
die "$? $!" if $?;
chomp $refs;
open U, "|git update-ref -m 'dgit bad commit fixup' --stdin" or die $!;
if ($real) {
- print "detaching your HEAD\n" or die $!;
- system 'git checkout --detach' and die "$! $?";
+ $!=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 "$! $?";
+ }
}
for my $up (@updates) {