aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2008-03-10 03:54:56 -0700
committerPaul Mackerras <paulus@samba.org>2008-03-11 20:22:39 +1100
commitcb8329aa9a6cc2e009d552b1180ce107cec4eb9d (patch)
treef63e1072ece6fd5c8460e5c35e280a263393cf7b
parent8809d691ec03f6cb60cb01c8bf00441600d6e757 (diff)
downloadgit-cb8329aa9a6cc2e009d552b1180ce107cec4eb9d.tar.gz
git-cb8329aa9a6cc2e009d552b1180ce107cec4eb9d.tar.xz
[PATCH] gitk: Don't show local changes when we there is no work tree
Launching gitk on a bare repository or a .git directory would previously show the work tree as having removed all files. We now inhibit showing local changes when gitk is not launched from within a work tree. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitk b/gitk
index 5a78a916e..5d9f589f0 100755
--- a/gitk
+++ b/gitk
@@ -403,6 +403,9 @@ proc readcommit {id} {
proc updatecommits {} {
global viewdata curview phase displayorder ordertok idpending
global children commitrow selectedline thickerline showneartags
+ global isworktree
+
+ set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
if {$phase ne {}} {
stop_rev_list
@@ -2885,8 +2888,9 @@ proc dohidelocalchanges {} {
# spawn off a process to do git diff-index --cached HEAD
proc dodiffindex {} {
global localirow localfrow lserial showlocalchanges
+ global isworktree
- if {!$showlocalchanges} return
+ if {!$showlocalchanges || !$isworktree} return
incr lserial
set localfrow -1
set localirow -1
@@ -8698,6 +8702,7 @@ set patchnum 0
set localirow -1
set localfrow -1
set lserial 0
+set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
setcoords
makewindow
# wait for the window to become visible