From 07a039c7bca9642b39cb39058ad96caa5b6d30f7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 30 Apr 2013 16:25:53 +0300 Subject: [PATCH] sort repos heads --- lib/gitlab_git/repository.rb | 2 +- spec/repository_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gitlab_git/repository.rb b/lib/gitlab_git/repository.rb index 402f393..1fdd928 100644 --- a/lib/gitlab_git/repository.rb +++ b/lib/gitlab_git/repository.rb @@ -125,7 +125,7 @@ def ref_names end def heads - @heads ||= repo.heads + @heads ||= repo.heads.sort_by(&:name) end def tree(fcommit, path = nil) diff --git a/spec/repository_spec.rb b/spec/repository_spec.rb index 2369a53..258142d 100644 --- a/spec/repository_spec.rb +++ b/spec/repository_spec.rb @@ -168,12 +168,12 @@ context :head do subject { heads.first } - its(:name) { should == 'deploy_keys' } + its(:name) { should == '2_3_notes_fix' } context :commit do subject { heads.first.commit } - its(:id) { should == 'dda6b0ab63eb8080e34b4273cfb6aadb7a29c028' } + its(:id) { should == '8470d70da67355c9c009e4401746b1d5410af2e3' } end end end