gitk: Disable checkout of remote branches
At the command line, trying to check out a remote branch gives you a detailed warning message, but the gitk GUI currently allows it without any fuss. Since the GUI is often used by people much less familiar with git, it seems reasonable to make the GUI more restrictive than the command line, not less. This prevents a lot of detached HEAD commits by new users. Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Sitaram Chamarty committed
Nov 3, 2009 at 21:30 UTC
70a5fc443acbd1fe69cc21c10190375facabaf93
1 file changed
+3
gitk
+3
@@ -8897,6 +8897,9 @@ proc headmenu {x y id head} {
8897
set headmenuid $id
8898
set headmenuhead $head
8899
set state normal
8900
+ if {[string match "remotes/*" $head]} {
8901
+ set state disabled
8902
+ }
8903
if {$head eq $mainhead} {
8904
set state disabled
8905
}