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
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-10-31 17:09:39 +0300
committerDouwe Maan <douwe@gitlab.com>2016-10-31 17:09:39 +0300
commit490776517c394ced2780159fa3800e2accc27601 (patch)
tree1cea0795bf80cf7a1431d356832cc798d9892edb /spec/models/repository_spec.rb
parent3645e684bf854b3588f5b5a8e069c6a6778a184a (diff)
parentfa3bbd449efb69a42a2347c3c3fa08cd822c2471 (diff)
Merge branch '22271-drone-tag-pipeline-build' into 'master'
Fix lightweight tags not processed correctly by GitTagPushService ## What does this MR do? Fix lightweight tags not processed correctly by GitTagPushService ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? Lightweight tags were being processed incorrectly, causing tag triggers to receive wrong information and not function properly. ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22271 See merge request !6532
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index b8204e1bf03..04b7d19d414 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -68,8 +68,8 @@ describe Repository, models: true do
double_first = double(committed_date: Time.now)
double_last = double(committed_date: Time.now - 1.second)
- allow(tag_a).to receive(:target).and_return(double_first)
- allow(tag_b).to receive(:target).and_return(double_last)
+ allow(tag_a).to receive(:dereferenced_target).and_return(double_first)
+ allow(tag_b).to receive(:dereferenced_target).and_return(double_last)
allow(repository).to receive(:tags).and_return([tag_a, tag_b])
end
@@ -83,8 +83,8 @@ describe Repository, models: true do
double_first = double(committed_date: Time.now - 1.second)
double_last = double(committed_date: Time.now)
- allow(tag_a).to receive(:target).and_return(double_last)
- allow(tag_b).to receive(:target).and_return(double_first)
+ allow(tag_a).to receive(:dereferenced_target).and_return(double_last)
+ allow(tag_b).to receive(:dereferenced_target).and_return(double_first)
allow(repository).to receive(:tags).and_return([tag_a, tag_b])
end
@@ -632,9 +632,9 @@ describe Repository, models: true do
context "when the branch wasn't empty" do
it 'updates the head' do
- expect(repository.find_branch('feature').target.id).to eq(old_rev)
+ expect(repository.find_branch('feature').dereferenced_target.id).to eq(old_rev)
repository.update_branch_with_hooks(user, 'feature') { new_rev }
- expect(repository.find_branch('feature').target.id).to eq(new_rev)
+ expect(repository.find_branch('feature').dereferenced_target.id).to eq(new_rev)
end
end
end
@@ -659,7 +659,7 @@ describe Repository, models: true do
context 'when the update would remove commits from the target branch' do
it 'raises an exception' do
branch = 'master'
- old_rev = repository.find_branch(branch).target.sha
+ old_rev = repository.find_branch(branch).dereferenced_target.sha
# The 'master' branch is NOT an ancestor of new_rev.
expect(repository.rugged.merge_base(old_rev, new_rev)).not_to eq(old_rev)