@matheusbsbs / matheus-bagliano / commits / 7f83aa2d3d
Fork 0

git-gui: Handle workdir detection when CYGWIN=nowinsymlinks

If the user has put nowinsymlinks into their CYGWIN environment variable any symlinks created by a Cygwin process (e.g. ln -s) will not have the ".lnk" suffix. In this case workdir is still a workdir, but our detection of looking for "info.lnk" fails as the symlink is actually a normal file called "info". Instead we just always use Cygwin's test executable to see if info/exclude is a file. If it is, we assume from there on it can be read by git-ls-files --others and is thus safe to use on the command line. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed May 21, 2008 at 16:40 UTC 7f83aa2d3df0623984e265052f96e7172e3efbeb
1 file changed +7 -16
git-gui.sh
+7 -16
@@ -1127,27 +1127,18 @@ proc rescan {after {honor_trustmtime 1}} {
1127 }
1128
1129 if {[is_Cygwin]} {
1130 - set is_git_info_link {}
1130 set is_git_info_exclude {}
1131 proc have_info_exclude {} {
1133 - global is_git_info_link is_git_info_exclude
1132 + global is_git_info_exclude
1133
1135 - if {$is_git_info_link eq {}} {
1136 - set is_git_info_link [file isfile [gitdir info.lnk]]
1137 - }
1138 -
1139 - if {$is_git_info_link} {
1140 - if {$is_git_info_exclude eq {}} {
1141 - if {[catch {exec test -f [gitdir info exclude]}]} {
1142 - set is_git_info_exclude 0
1143 - } else {
1144 - set is_git_info_exclude 1
1145 - }
1134 + if {$is_git_info_exclude eq {}} {
1135 + if {[catch {exec test -f [gitdir info exclude]}]} {
1136 + set is_git_info_exclude 0
1137 + } else {
1138 + set is_git_info_exclude 1
1139 }
1147 - return $is_git_info_exclude
1148 - } else {
1149 - return [file readable [gitdir info exclude]]
1140 }
1141 + return $is_git_info_exclude
1142 }
1143 } else {
1144 proc have_info_exclude {} {