@matheusbsbs / matheus-bagliano / commits / cb8329aa9a
Fork 0

[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>

David Aguilar committed Mar 10, 2008 at 03:54 UTC cb8329aa9a6cc2e009d552b1180ce107cec4eb9d
1 file changed +6 -1
gitk
+6 -1
@@ -403,6 +403,9 @@ proc readcommit {id} {
403 proc updatecommits {} {
404 global viewdata curview phase displayorder ordertok idpending
405 global children commitrow selectedline thickerline showneartags
406 + global isworktree
407 +
408 + set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
409
410 if {$phase ne {}} {
411 stop_rev_list
@@ -2885,8 +2888,9 @@ proc dohidelocalchanges {} {
2888 # spawn off a process to do git diff-index --cached HEAD
2889 proc dodiffindex {} {
2890 global localirow localfrow lserial showlocalchanges
2891 + global isworktree
2892
2889 - if {!$showlocalchanges} return
2893 + if {!$showlocalchanges || !$isworktree} return
2894 incr lserial
2895 set localfrow -1
2896 set localirow -1
@@ -8698,6 +8702,7 @@ set patchnum 0
8702 set localirow -1
8703 set localfrow -1
8704 set lserial 0
8705 +set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
8706 setcoords
8707 makewindow
8708 # wait for the window to become visible