From 3247f47c8d5076721649f345af7a36f41f47969f Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Fri, 22 Jun 2018 11:05:08 +0200 Subject: Git ls files is Gitaly only now Moved to the front on the line through: https://gitlab.com/gitlab-org/gitlab-ce/issues/47893 Closes: https://gitlab.com/gitlab-org/gitlab-ce/issues/47893 Closes: https://gitlab.com/gitlab-org/gitaly/issues/327 --- lib/gitlab/git/repository.rb | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 7056d9c8756..2b599ee9f82 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -946,13 +946,7 @@ module Gitlab # # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/327 def ls_files(ref) - gitaly_migrate(:ls_files) do |is_enabled| - if is_enabled - gitaly_ls_files(ref) - else - git_ls_files(ref) - end - end + gitaly_commit_client.ls_files(ref) end # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/328 @@ -1836,33 +1830,6 @@ module Gitlab gitaly_repository_client.repository_size end - def gitaly_ls_files(ref) - gitaly_commit_client.ls_files(ref) - end - - def git_ls_files(ref) - actual_ref = ref || root_ref - - begin - sha_from_ref(actual_ref) - rescue Rugged::OdbError, Rugged::InvalidError, Rugged::ReferenceError - # Return an empty array if the ref wasn't found - return [] - end - - cmd = %W(ls-tree -r --full-tree --full-name -- #{actual_ref}) - raw_output, _status = run_git(cmd) - - lines = raw_output.split("\n").map do |f| - stuff, path = f.split("\t") - _mode, type, _sha = stuff.split(" ") - path if type == "blob" - # Contain only blob type - end - - lines.compact - end - # Returns true if the given ref name exists # # Ref names must start with `refs/`. -- cgit v1.2.1