aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-07 00:20:56 -0500
committerShawn O. Pearce <spearce@spearce.org>2006-11-07 03:05:18 -0500
commitb8ce6f0ec8a275bf9e32ff7666d00a88154fd50b (patch)
treefc7877caa6f08c717aec3d307e378033673f303d
parentcc4b1c0213ad2d99121135125b8c2ea630bebe3d (diff)
downloadgit-b8ce6f0ec8a275bf9e32ff7666d00a88154fd50b.tar.gz
git-gui: Reorganized startup procedure to ensure gitdir is right.
Because we cd after getting the cdup value from Git we can't try to get the gitdir until after we perform the cd, as usually the gitdir is relative to the current working directory. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xgit-gui14
1 files changed, 10 insertions, 4 deletions
diff --git a/git-gui b/git-gui
index be361dec17..87dcbaef4c 100755
--- a/git-gui
+++ b/git-gui
@@ -939,7 +939,7 @@ proc error_popup {msg} {
}
proc show_msg {w top msg} {
- global gitdir appname
+ global gitdir appname mainfont
message $w.m -text $msg -justify left -aspect 400
pack $w.m -side top -fill x -padx 5 -pady 10
@@ -1465,17 +1465,23 @@ unset i M1B M1T
##
## main
-if {[catch {set gitdir [exec git rev-parse --git-dir]} err]} {
+set appname [lindex [file split $argv0] end]
+set gitdir {}
+
+if {[catch {set cdup [exec git rev-parse --show-cdup]} err]} {
show_msg {} . "Cannot find the git directory: $err"
exit 1
}
-set cdup [exec git rev-parse --show-cdup]
if {$cdup != ""} {
cd $cdup
}
unset cdup
-set appname [lindex [file split $argv0] end]
+if {[catch {set gitdir [exec git rev-parse --git-dir]} err]} {
+ show_msg {} . "Cannot find the git directory: $err"
+ exit 1
+}
+
if {$appname == {git-citool}} {
set single_commit 1
}