Skip to content

Commit 70a5fc4

Browse files
sitaramcpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 51a7e8b commit 70a5fc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gitk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8897,6 +8897,9 @@ proc headmenu {x y id head} {
88978897
set headmenuid $id
88988898
set headmenuhead $head
88998899
set state normal
8900+
if {[string match "remotes/*" $head]} {
8901+
set state disabled
8902+
}
89008903
if {$head eq $mainhead} {
89018904
set state disabled
89028905
}

0 commit comments

Comments
 (0)