summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-07-12 19:00:43 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-07-19 19:30:10 +0100
commit1c39395964862ba5cad29119e7b5b8f528678f0a (patch)
tree0358e4e887427711743bfd794b4414a264aa2327
parent3ec01e576e52bf4ef6638701854ad8d1395bf285 (diff)
downloadgitlab-ce-1c39395964862ba5cad29119e7b5b8f528678f0a.tar.gz
refactors the search to enable users to filter and sort branches at the
same time and writes tests accordingly changes schema.db removes duplicate field inside CHANGELOG fix db/schema
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/repository.rb4
-rw-r--r--app/views/projects/branches/index.html.haml1
-rw-r--r--db/schema.rb2
-rw-r--r--spec/finders/branches_finder_spec.rb1
5 files changed, 2 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d56db8fff99..a5d26db7626 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,7 +8,6 @@ v 8.10.0 (unreleased)
- Add the functionality to be able to rename a file. !5049 (tiagonbotelho)
- Disable PostgreSQL statement timeout during migrations
- Fix projects dropdown loading performance with a simplified api cal. !5113 (tiagonbotelho)
- - User can now filter branches by name on /branches page. !5144 (tiagonbotelho)
- Fix commit builds API, return all builds for all pipelines for given commit. !4849
- Replace Haml with Hamlit to make view rendering faster. !3666
- Refresh the branch cache after `git gc` runs
diff --git a/app/models/repository.rb b/app/models/repository.rb
index ed7c19eb181..61f6d52dfd3 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -125,10 +125,6 @@ class Repository
commits
end
- def find_similar_branches(search)
- raw_repository.branches.select { |branch| branch.name.include?(search) }
- end
-
def find_branch(name)
raw_repository.branches.find { |branch| branch.name == name }
end
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index c43e19f4155..6f806e3ce53 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -27,7 +27,6 @@
= sort_title_recently_updated
= link_to filter_branches_path(sort: 'last_updated') do
= sort_title_oldest_updated
-
= link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
New branch
- if @branches.any?
diff --git a/db/schema.rb b/db/schema.rb
index 014ffc27dd9..8882377f9f4 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -84,10 +84,10 @@ ActiveRecord::Schema.define(version: 20160716115710) do
t.string "health_check_access_token"
t.boolean "send_user_confirmation_email", default: false
t.integer "container_registry_token_expire_delay", default: 5
+ t.boolean "user_default_external", default: false, null: false
t.text "after_sign_up_text"
t.string "repository_storage", default: "default"
t.string "enabled_git_access_protocol"
- t.boolean "user_default_external", default: false, null: false
end
create_table "audit_events", force: :cascade do |t|
diff --git a/spec/finders/branches_finder_spec.rb b/spec/finders/branches_finder_spec.rb
index e4281431280..9c9763d746b 100644
--- a/spec/finders/branches_finder_spec.rb
+++ b/spec/finders/branches_finder_spec.rb
@@ -17,6 +17,7 @@ describe BranchesFinder do
it 'sorts by recently_updated' do
branches_finder = described_class.new(repository, { sort: 'recently_updated' })
+
result = branches_finder.execute
expect(result.first.name).to eq('expand-collapse-lines')