[PATCH] gitk: do not show local changes for bare repositories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Launching gitk on a bare repository would previously show the
work tree as having removed all files.  We now query for
bare repositories in updatecommits and test the value in
dodiffindex before showing local changes.

Signed-off-by: David Aguilar <davvid@xxxxxxxxx>
---
 gitk |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index f1f21e9..080459d 100755
--- a/gitk
+++ b/gitk
@@ -393,6 +393,7 @@ proc readcommit {id} {
 proc updatecommits {} {
     global viewdata curview phase displayorder ordertok idpending
     global children commitrow selectedline thickerline showneartags
+    global isbare
 
     if {$phase ne {}} {
 	stop_rev_list
@@ -407,6 +408,7 @@ proc updatecommits {} {
     foreach vid [array names idpending "$n,*"] {
 	unset idpending($vid)
     }
+    set isbare [expr {[exec git rev-parse --is-bare-repository] == "true"}]
     set curview -1
     catch {unset selectedline}
     catch {unset thickerline}
@@ -2843,9 +2845,9 @@ proc dohidelocalchanges {} {
 
 # spawn off a process to do git diff-index --cached HEAD
 proc dodiffindex {} {
-    global localirow localfrow lserial showlocalchanges
+    global localirow localfrow lserial showlocalchanges isbare
 
-    if {!$showlocalchanges} return
+    if {!$showlocalchanges || $isbare} return
     incr lserial
     set localfrow -1
     set localirow -1
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux