Skip to content

Commit c939344

Browse files
committed
git-gui: remove unused git-version
git-version supports choosing different bodies of code passed into it, rather than using the more traditional if/else construct typically used. The only use of git-version in this mode was by its author in 2007, and that code has been deleted. So, delete this now unused function that was mostly ignored. Signed-off-by: Mark Levedahl <[email protected]>
1 parent c855570 commit c939344

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

git-gui.sh

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,50 +1029,6 @@ if {[catch {set vcheck [package vcompare $_git_version $MIN_GIT_VERSION]}] ||
10291029
}
10301030
unset _real_git_version
10311031

1032-
proc git-version {args} {
1033-
global _git_version
1034-
1035-
switch [llength $args] {
1036-
0 {
1037-
return $_git_version
1038-
}
1039-
1040-
2 {
1041-
set op [lindex $args 0]
1042-
set vr [lindex $args 1]
1043-
set cm [package vcompare $_git_version $vr]
1044-
return [expr $cm $op 0]
1045-
}
1046-
1047-
4 {
1048-
set type [lindex $args 0]
1049-
set name [lindex $args 1]
1050-
set parm [lindex $args 2]
1051-
set body [lindex $args 3]
1052-
1053-
if {($type ne {proc} && $type ne {method})} {
1054-
error "Invalid arguments to git-version"
1055-
}
1056-
if {[llength $body] < 2 || [lindex $body end-1] ne {default}} {
1057-
error "Last arm of $type $name must be default"
1058-
}
1059-
1060-
foreach {op vr cb} [lrange $body 0 end-2] {
1061-
if {[git-version $op $vr]} {
1062-
return [uplevel [list $type $name $parm $cb]]
1063-
}
1064-
}
1065-
1066-
return [uplevel [list $type $name $parm [lindex $body end]]]
1067-
}
1068-
1069-
default {
1070-
error "git-version >= x"
1071-
}
1072-
1073-
}
1074-
}
1075-
10761032
######################################################################
10771033
##
10781034
## configure our library

0 commit comments

Comments
 (0)