summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4aca740)
raw | patch | inline | side by side (parent: 4aca740)
author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 16 Nov 2006 03:45:33 +0000 (22:45 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 18 Nov 2006 04:56:15 +0000 (23:56 -0500) |
Since we have some serious problems with the GIT_DIR environment variable
on Windows we cannot let the user use a non-standard GIT_DIR with their
working directory.
So require that the GIT_DIR name is actually ".git", that it exists,
and that its parent directory is our working directory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
on Windows we cannot let the user use a non-standard GIT_DIR with their
working directory.
So require that the GIT_DIR name is actually ".git", that it exists,
and that its parent directory is our working directory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index def6a5e070766ed42b1ef16d46c9e678fe07bc85..c35c73c8c3a603efb3ec8580e3bbea51721d8fb7 100755 (executable)
--- a/git-gui
+++ b/git-gui
error_popup "Cannot find the git directory:\n\n$err"
exit 1
}
+if {![file isdirectory $gitdir]} {
+ catch {wm withdraw .}
+ error_popup "Git directory not found:\n\n$gitdir"
+ exit 1
+}
+if {[lindex [file split $gitdir] end] ne {.git}} {
+ catch {wm withdraw .}
+ error_popup "Cannot use funny .git directory:\n\n$gitdir"
+ exit 1
+}
if {[catch {cd [file dirname $gitdir]} err]} {
catch {wm withdraw .}
error_popup "No working directory [file dirname $gitdir]:\n\n$err"
--absolute \
$gitdir]
puts -nonewline $fd "\"$sh\" --login -c \""
- puts -nonewline $fd "GIT_DIR=\\\"$gd\\\""
- puts -nonewline $fd " \\\"$me\\\""
+ puts -nonewline $fd "GIT_DIR='$gd'"
+ puts -nonewline $fd " '$me'"
puts $fd "&\""
close $fd
} err]} {