chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9908f9
)
badcommit-fixup: only detach bare
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 5 Jan 2017 02:04:12 +0000
(
02:04
+0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 5 Jan 2017 02:04:12 +0000
(
02:04
+0000)
badcommit-fixup
patch
|
blob
|
history
diff --git
a/badcommit-fixup
b/badcommit-fixup
index 1fa95d5fc31009f9a2ffd22e155d3e282abe43f9..b8cb88adbaaf9e257dfd94152f1b4176de94d3e6 100755
(executable)
--- a/
badcommit-fixup
+++ b/
badcommit-fixup
@@
-132,8
+132,13
@@
foreach my $rline (split /\n/, $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) {