84
global env _search_exe _search_path
85
86
if {$_search_path eq {}} {
87
- if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
88
- set _search_path [split [exec cygpath \
89
- --windows \
90
- --path \
91
- --absolute \
92
- $env(PATH)] {;}]
93
- set _search_exe .exe
94
- } elseif {[is_Windows]} {
87
+ if {[is_Windows]} {
88
set gitguidir [file dirname [info script]]
89
regsub -all ";" $gitguidir "\\;" gitguidir
90
set env(PATH) "$gitguidir;$env(PATH)"
335
if {[catch {set _gitexec [git --exec-path]} err]} {
336
error "Git not installed?\n\n$err"
337
}
345
- if {[is_Cygwin]} {
346
- set _gitexec [exec cygpath \
347
- --windows \
348
- --absolute \
349
- $_gitexec]
350
- } else {
351
- set _gitexec [file normalize $_gitexec]
352
- }
338
+ set _gitexec [file normalize $_gitexec]
339
}
340
if {$args eq {}} {
341
return $_gitexec
350
# Git not installed or option not yet supported
351
return {}
352
}
367
- if {[is_Cygwin]} {
368
- set _githtmldir [exec cygpath \
369
- --windows \
370
- --absolute \
371
- $_githtmldir]
372
- } else {
373
- set _githtmldir [file normalize $_githtmldir]
374
- }
353
+ set _githtmldir [file normalize $_githtmldir]
354
}
355
if {$args eq {}} {
356
return $_githtmldir
1297
set _gitdir [pwd]
1298
}
1299
1321
-if {![file isdirectory $_gitdir] && [is_Cygwin]} {
1322
- catch {set _gitdir [exec cygpath --windows $_gitdir]}
1323
-}
1300
if {![file isdirectory $_gitdir]} {
1301
catch {wm withdraw .}
1302
error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]
1308
1309
# v1.7.0 introduced --show-toplevel to return the canonical work-tree
1310
if {[package vcompare $_git_version 1.7.0] >= 0} {
1335
- if { [is_Cygwin] } {
1336
- catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
1337
- } else {
1338
- set _gitworktree [git rev-parse --show-toplevel]
1339
- }
1311
+ set _gitworktree [git rev-parse --show-toplevel]
1312
} else {
1313
# try to set work tree from environment, core.worktree or use
1314
# cdup to obtain a relative path to the top of the worktree. If
1533
}
1534
}
1535
1564
-if {[is_Cygwin]} {
1565
- set is_git_info_exclude {}
1566
- proc have_info_exclude {} {
1567
- global is_git_info_exclude
1568
-
1569
- if {$is_git_info_exclude eq {}} {
1570
- if {[catch {exec test -f [gitdir info exclude]}]} {
1571
- set is_git_info_exclude 0
1572
- } else {
1573
- set is_git_info_exclude 1
1574
- }
1575
- }
1576
- return $is_git_info_exclude
1577
- }
1578
-} else {
1579
- proc have_info_exclude {} {
1580
- return [file readable [gitdir info exclude]]
1581
- }
1536
+proc have_info_exclude {} {
1537
+ return [file readable [gitdir info exclude]]
1538
}
1539
1540
proc rescan_stage2 {fd after} {
3068
set doc_path [githtmldir]
3069
if {$doc_path ne {}} {
3070
set doc_path [file join $doc_path index.html]
3115
-
3116
- if {[is_Cygwin]} {
3117
- set doc_path [exec cygpath --mixed $doc_path]
3118
- }
3071
}
3072
3073
if {[file isfile $doc_path]} {
4039
wm title . "[appname] ([reponame]) [file normalize $_gitworktree]"
4040
focus -force $ui_comm
4041
4090
-# -- Warn the user about environmental problems. Cygwin's Tcl
4091
-# does *not* pass its env array onto any processes it spawns.
4092
-# This means that git processes get none of our environment.
4093
-#
4094
-if {[is_Cygwin]} {
4095
- set ignored_env 0
4096
- set suggest_user {}
4097
- set msg [mc "Possible environment issues exist.
4098
-
4099
-The following environment variables are probably
4100
-going to be ignored by any Git subprocess run
4101
-by %s:
4102
-
4103
-" [appname]]
4104
- foreach name [array names env] {
4105
- switch -regexp -- $name {
4106
- {^GIT_INDEX_FILE$} -
4107
- {^GIT_OBJECT_DIRECTORY$} -
4108
- {^GIT_ALTERNATE_OBJECT_DIRECTORIES$} -
4109
- {^GIT_DIFF_OPTS$} -
4110
- {^GIT_EXTERNAL_DIFF$} -
4111
- {^GIT_PAGER$} -
4112
- {^GIT_TRACE$} -
4113
- {^GIT_CONFIG$} -
4114
- {^GIT_(AUTHOR|COMMITTER)_DATE$} {
4115
- append msg " - $name\n"
4116
- incr ignored_env
4117
- }
4118
- {^GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL)$} {
4119
- append msg " - $name\n"
4120
- incr ignored_env
4121
- set suggest_user $name
4122
- }
4123
- }
4124
- }
4125
- if {$ignored_env > 0} {
4126
- append msg [mc "
4127
-This is due to a known issue with the
4128
-Tcl binary distributed by Cygwin."]
4129
-
4130
- if {$suggest_user ne {}} {
4131
- append msg [mc "
4132
-
4133
-A good replacement for %s
4134
-is placing values for the user.name and
4135
-user.email settings into your personal
4136
-~/.gitconfig file.
4137
-" $suggest_user]
4138
- }
4139
- warn_popup $msg
4140
- }
4141
- unset ignored_env msg suggest_user name
4142
-}
4143
-
4042
# -- Only initialize complex UI if we are going to stay running.
4043
#
4044
if {[is_enabled transport]} {