summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-02 19:30:26 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-09-04 03:01:44 (GMT)
commit881d8f24cab5bf4e0fa71b17a3ab82e27b2e8ed7 (patch)
treeb6d9e239421b40eebe456021731344e09b803547 /lib
parent6e4ba05c7fee0d0140e2057b63f5ca4eea9a6053 (diff)
downloadgit-881d8f24cab5bf4e0fa71b17a3ab82e27b2e8ed7.zip
git-881d8f24cab5bf4e0fa71b17a3ab82e27b2e8ed7.tar.gz
git-881d8f24cab5bf4e0fa71b17a3ab82e27b2e8ed7.tar.bz2
git-gui: Fix detaching current branch during checkout
If the user tried to detach their HEAD while keeping the working directory on the same commit we actually did not completely do a detach operation internally. The problem was caused by git-gui not forcing the HEAD symbolic ref to be updated to a SHA-1 hash when we were not switching revisions. Now we update the HEAD ref if we aren't currently detached or the hashes don't match. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/checkout_op.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/checkout_op.tcl b/lib/checkout_op.tcl
index 170f737..76f04f2 100644
--- a/lib/checkout_op.tcl
+++ b/lib/checkout_op.tcl
@@ -396,7 +396,7 @@ method _after_readtree {} {
set is_detached 0
}
} else {
- if {$new_hash ne $HEAD} {
+ if {!$is_detached || $new_hash ne $HEAD} {
append log " to $new_expr"
if {[catch {
_detach_HEAD $log $new_hash