Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-02-22 14:34:03 +0300
committerDouwe Maan <douwe@gitlab.com>2018-02-22 14:34:03 +0300
commite503efa320b05939f290f09e79c3b6fe98fb7803 (patch)
treefaf2ecf1a279f37f42cd7ead9006e41f6a4de467 /spec
parent6ad7eceb5cfac766b1942ac7b85380869071b58d (diff)
parente70fe78281ba07d9a0eb863d66ddf6a13917fde1 (diff)
Merge branch 'zj-branch-contains-git-message' into 'master'
Allow branchnames to be named the same as the commit it points to See merge request gitlab-org/gitlab-ce!17231
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index 67271d769a0..464be6c6c5d 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -600,6 +600,33 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
+ describe '#branch_names_contains_sha' do
+ shared_examples 'returning the right branches' do
+ let(:head_id) { repository.rugged.head.target.oid }
+ let(:new_branch) { head_id }
+
+ before do
+ repository.create_branch(new_branch, 'master')
+ end
+
+ after do
+ repository.delete_branch(new_branch)
+ end
+
+ it 'displays that branch' do
+ expect(repository.branch_names_contains_sha(head_id)).to include('master', new_branch)
+ end
+ end
+
+ context 'when Gitaly is enabled' do
+ it_behaves_like 'returning the right branches'
+ end
+
+ context 'when Gitaly is disabled', :disable_gitaly do
+ it_behaves_like 'returning the right branches'
+ end
+ end
+
describe "#refs_hash" do
subject { repository.refs_hash }