aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Levedahl <mlevedahl@gmail.com>2025-05-02 11:39:55 -0400
committerTaylor Blau <me@ttaylorr.com>2025-05-23 17:04:23 -0400
commitf9a2e8a38f524c04fc493548303488dc180b25bd (patch)
tree67f34df72b03cbdf12a448f184f03dca8d676be8
parentgit-gui: remove Tcl 8.4 workaround on 2>@1 redirection (diff)
downloadgit-f9a2e8a38f524c04fc493548303488dc180b25bd.tar.gz
git-f9a2e8a38f524c04fc493548303488dc180b25bd.zip
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 0730a5a3a, git-gui requires git v2.36 or later). Keep only the code for modern Git. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> [j6t: message tweaked] Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Taylor Blau <me@ttaylorr.com>
-rw-r--r--lib/checkout_op.tcl14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/checkout_op.tcl b/lib/checkout_op.tcl
index 21ea768d80..5f7011078a 100644
--- a/lib/checkout_op.tcl
+++ b/lib/checkout_op.tcl
@@ -510,18 +510,8 @@ method _update_repo_state {} {
delete_this
}
-git-version proc _detach_HEAD {log new} {
- >= 1.5.3 {
- git update-ref --no-deref -m $log HEAD $new
- }
- default {
- set p [gitdir HEAD]
- file delete $p
- set fd [open $p w]
- fconfigure $fd -translation lf -encoding utf-8
- puts $fd $new
- close $fd
- }
+proc _detach_HEAD {log new} {
+ git update-ref --no-deref -m $log HEAD $new
}
method _confirm_reset {cur} {