summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-gui b/git-gui
index def6a5e070..c35c73c8c3 100755
--- a/git-gui
+++ b/git-gui
@@ -167,6 +167,16 @@ if { [catch {set gitdir $env(GIT_DIR)}]
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"
@@ -2040,8 +2050,8 @@ proc do_windows_shortcut {} {
--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]} {