From f7b3f6bb486c211ed4419560d52125b14b979087 Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Wed, 23 Apr 2008 00:12:01 -0700 Subject: [PATCH] Select active branch when starting up --- CommitsController.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CommitsController.rb b/CommitsController.rb index ca0284a..e7fede3 100644 --- a/CommitsController.rb +++ b/CommitsController.rb @@ -36,7 +36,8 @@ def awakeFromNib hash[email] = NSImage.imageNamed(NSImageNameUser) end - if(fetch_git_repository) + if fetch_git_repository + fetch_git_branch setup_commit_detail_view fetch_commits_for @branch, @offset setup_branches_menu @@ -235,6 +236,11 @@ def fetch_git_repository end end + def fetch_git_branch + head = @repo.head || @repo.heads.first + @branch = head.name.to_sym + end + def fetch_commits_for(branch, quanity, offset = 0) @commits = @repo.commits(branch, quanity, offset) end