aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-12-16 20:41:28 +0100
committerPratyush Yadav <me@yadavpratyush.com>2023-01-24 14:10:40 +0100
commite0539b4b25310e242d30b91a2c86f5e7a30aade6 (patch)
treeb7a55d5062bcf00f95afc9231c45b07d96794d67
parentc5766eae6f2b002396b6cd4f85b62317b707174e (diff)
downloadgit-e0539b4b25310e242d30b91a2c86f5e7a30aade6.tar.gz
Move is_<platform> functions to the beginning
We need these in `_which` and they should be defined before that function's definition. This commit is best viewed with `--color-moved`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
-rwxr-xr-xgit-gui.sh58
1 files changed, 31 insertions, 27 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 0fe60f80cc..f779fc9268 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -46,6 +46,37 @@ catch {rename send {}} ; # What an evil concept...
######################################################################
##
+## Enabling platform-specific code paths
+
+proc is_MacOSX {} {
+ if {[tk windowingsystem] eq {aqua}} {
+ return 1
+ }
+ return 0
+}
+
+proc is_Windows {} {
+ if {$::tcl_platform(platform) eq {windows}} {
+ return 1
+ }
+ return 0
+}
+
+set _iscygwin {}
+proc is_Cygwin {} {
+ global _iscygwin
+ if {$_iscygwin eq {}} {
+ if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
+ set _iscygwin 1
+ } else {
+ set _iscygwin 0
+ }
+ }
+ return $_iscygwin
+}
+
+######################################################################
+##
## locate our library
if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
@@ -163,7 +194,6 @@ set _isbare {}
set _gitexec {}
set _githtmldir {}
set _reponame {}
-set _iscygwin {}
set _search_path {}
set _shellpath {@@SHELL_PATH@@}
@@ -252,32 +282,6 @@ proc reponame {} {
return $::_reponame
}
-proc is_MacOSX {} {
- if {[tk windowingsystem] eq {aqua}} {
- return 1
- }
- return 0
-}
-
-proc is_Windows {} {
- if {$::tcl_platform(platform) eq {windows}} {
- return 1
- }
- return 0
-}
-
-proc is_Cygwin {} {
- global _iscygwin
- if {$_iscygwin eq {}} {
- if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
- set _iscygwin 1
- } else {
- set _iscygwin 0
- }
- }
- return $_iscygwin
-}
-
proc is_enabled {option} {
global enabled_options
if {[catch {set on $enabled_options($option)}]} {return 0}