Skip to content

Commit db41105

Browse files
committed
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 <[email protected]>
1 parent bddf4ef commit db41105

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

git-gui.sh

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,37 @@ if {[catch {package require Tcl 8.5} err]
4444

4545
catch {rename send {}} ; # What an evil concept...
4646

47+
######################################################################
48+
##
49+
## Enabling platform-specific code paths
50+
51+
proc is_MacOSX {} {
52+
if {[tk windowingsystem] eq {aqua}} {
53+
return 1
54+
}
55+
return 0
56+
}
57+
58+
proc is_Windows {} {
59+
if {$::tcl_platform(platform) eq {windows}} {
60+
return 1
61+
}
62+
return 0
63+
}
64+
65+
set _iscygwin {}
66+
proc is_Cygwin {} {
67+
global _iscygwin
68+
if {$_iscygwin eq {}} {
69+
if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
70+
set _iscygwin 1
71+
} else {
72+
set _iscygwin 0
73+
}
74+
}
75+
return $_iscygwin
76+
}
77+
4778
######################################################################
4879
##
4980
## locate our library
@@ -163,7 +194,6 @@ set _isbare {}
163194
set _gitexec {}
164195
set _githtmldir {}
165196
set _reponame {}
166-
set _iscygwin {}
167197
set _search_path {}
168198
set _shellpath {@@SHELL_PATH@@}
169199

@@ -252,32 +282,6 @@ proc reponame {} {
252282
return $::_reponame
253283
}
254284

255-
proc is_MacOSX {} {
256-
if {[tk windowingsystem] eq {aqua}} {
257-
return 1
258-
}
259-
return 0
260-
}
261-
262-
proc is_Windows {} {
263-
if {$::tcl_platform(platform) eq {windows}} {
264-
return 1
265-
}
266-
return 0
267-
}
268-
269-
proc is_Cygwin {} {
270-
global _iscygwin
271-
if {$_iscygwin eq {}} {
272-
if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
273-
set _iscygwin 1
274-
} else {
275-
set _iscygwin 0
276-
}
277-
}
278-
return $_iscygwin
279-
}
280-
281285
proc is_enabled {option} {
282286
global enabled_options
283287
if {[catch {set on $enabled_options($option)}]} {return 0}

0 commit comments

Comments
 (0)