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>
This commit is contained in:
parent
16dd62ac4d
commit
7f83aa2d3d
23
git-gui.sh
23
git-gui.sh
@ -1127,27 +1127,18 @@ proc rescan {after {honor_trustmtime 1}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if {[is_Cygwin]} {
|
if {[is_Cygwin]} {
|
||||||
set is_git_info_link {}
|
|
||||||
set is_git_info_exclude {}
|
set is_git_info_exclude {}
|
||||||
proc have_info_exclude {} {
|
proc have_info_exclude {} {
|
||||||
global is_git_info_link is_git_info_exclude
|
global is_git_info_exclude
|
||||||
|
|
||||||
if {$is_git_info_link eq {}} {
|
if {$is_git_info_exclude eq {}} {
|
||||||
set is_git_info_link [file isfile [gitdir info.lnk]]
|
if {[catch {exec test -f [gitdir info exclude]}]} {
|
||||||
}
|
set is_git_info_exclude 0
|
||||||
|
} else {
|
||||||
if {$is_git_info_link} {
|
set is_git_info_exclude 1
|
||||||
if {$is_git_info_exclude eq {}} {
|
|
||||||
if {[catch {exec test -f [gitdir info exclude]}]} {
|
|
||||||
set is_git_info_exclude 0
|
|
||||||
} else {
|
|
||||||
set is_git_info_exclude 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $is_git_info_exclude
|
|
||||||
} else {
|
|
||||||
return [file readable [gitdir info exclude]]
|
|
||||||
}
|
}
|
||||||
|
return $is_git_info_exclude
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
proc have_info_exclude {} {
|
proc have_info_exclude {} {
|
||||||
|
Loading…
Reference in New Issue
Block a user