summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-05-21 20:40:10 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-05-22 12:34:00 (GMT)
commit7f83aa2d3df0623984e265052f96e7172e3efbeb (patch)
treec88551a69ad709ad787b769e019b23152ec03de6
parent16dd62ac4de10c9ae27d29bb1c906ad97ac8908f (diff)
downloadgit-7f83aa2d3df0623984e265052f96e7172e3efbeb.zip
git-7f83aa2d3df0623984e265052f96e7172e3efbeb.tar.gz
git-7f83aa2d3df0623984e265052f96e7172e3efbeb.tar.bz2
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>
-rwxr-xr-xgit-gui.sh23
1 files changed, 7 insertions, 16 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 6a8831a..e6e8890 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1127,27 +1127,18 @@ proc rescan {after {honor_trustmtime 1}} {
}
if {[is_Cygwin]} {
- set is_git_info_link {}
set is_git_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 {}} {
- set is_git_info_link [file isfile [gitdir info.lnk]]
- }
-
- if {$is_git_info_link} {
- 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
- }
+ 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 {
proc have_info_exclude {} {