public
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/Caged/gitnub.git
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
Fixes #27: Launching from a repo that hasn't had an initial import
Caged (author)
Fri Aug 22 10:30:30 -0700 2008
commit  cb3fdfc79fa0fd91ff38653c162eb046e18c13c1
tree    24f42fb94c83481f72884a7ae1a59652a4588bd8
parent  0812fc6ab092e9c4bf1e5957331a1357ecc6a3b1
...
117
118
119
120
121
 
 
 
 
122
123
124
...
139
140
141
142
 
143
144
145
...
117
118
119
 
 
120
121
122
123
124
125
126
...
141
142
143
 
144
145
146
147
0
@@ -117,8 +117,10 @@ class ApplicationController < OSX::NSObject
0
     def setup_refs_view_menu
0
       [@local_branches_menu, @remote_branches_menu, @tags_menu].each { |m| m.submenu.setAutoenablesItems(false) }
0
       
0
-      heads = repo.heads.sort_by do |head|
0
-        head.name == 'master' ? "***" : head.name
0
+      heads = repo.heads.reject { |head| head.nil? }
0
+      heads = heads.sort_by do |head|
0
+        name = head.name rescue "temp head"
0
+        name == 'master' ? "***" : name
0
       end
0
       
0
       add_menu_item = lambda do |refs, menu|
0
@@ -139,7 +141,7 @@ class ApplicationController < OSX::NSObject
0
       add_menu_item.call(repo.remotes, @branch_select.menu.itemAtIndex(1))  #remote
0
       add_menu_item.call(repo.tags, @branch_select.menu.itemAtIndex(2))     #tags
0
       
0
-      current_head = repo.heads.first.name.to_sym 
0
+      current_head = repo.heads.first.name.to_sym rescue nil
0
       item = @branch_select.itemAtIndex(0).submenu.itemWithTitle(current_head || :master)
0
       @branch_select.cell.setMenuItem(item)
0
     end  

Comments