Skip to content

Commit f9a2e8a

Browse files
mark987ttaylorr
authored andcommitted
git-gui: remove HEAD detachment implementation for git < 1.5.3
git-gui provides an implementation to detach HEAD on Git versions prior to 1.5.3. Nobody should be using such an old version anymore. (Moreover, since 0730a5a, git-gui requires git v2.36 or later). Keep only the code for modern Git. Signed-off-by: Mark Levedahl <[email protected]> [j6t: message tweaked] Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 4774c70 commit f9a2e8a

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

lib/checkout_op.tcl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -510,18 +510,8 @@ method _update_repo_state {} {
510510
delete_this
511511
}
512512

513-
git-version proc _detach_HEAD {log new} {
514-
>= 1.5.3 {
515-
git update-ref --no-deref -m $log HEAD $new
516-
}
517-
default {
518-
set p [gitdir HEAD]
519-
file delete $p
520-
set fd [open $p w]
521-
fconfigure $fd -translation lf -encoding utf-8
522-
puts $fd $new
523-
close $fd
524-
}
513+
proc _detach_HEAD {log new} {
514+
git update-ref --no-deref -m $log HEAD $new
525515
}
526516

527517
method _confirm_reset {cur} {

0 commit comments

Comments
 (0)