Skip to content

Commit

Permalink
[PATCH] gitk: Don't show local changes when we there is no work tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Aguilar authored and Paul Mackerras committed Mar 11, 2008
1 parent 8809d69 commit cb8329a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cb8329a

Please sign in to comment.