Skip to content

Commit 7f83aa2

Browse files
committed
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>
1 parent 16dd62a commit 7f83aa2

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

git-gui.sh

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,27 +1127,18 @@ proc rescan {after {honor_trustmtime 1}} {
11271127
}
11281128
11291129
if {[is_Cygwin]} {
1130-
set is_git_info_link {}
11311130
set is_git_info_exclude {}
11321131
proc have_info_exclude {} {
1133-
global is_git_info_link is_git_info_exclude
1132+
global is_git_info_exclude
11341133
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
11461139
}
1147-
return $is_git_info_exclude
1148-
} else {
1149-
return [file readable [gitdir info exclude]]
11501140
}
1141+
return $is_git_info_exclude
11511142
}
11521143
} else {
11531144
proc have_info_exclude {} {

0 commit comments

Comments
 (0)