summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-22 11:05:08 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-22 11:14:34 +0200
commit3247f47c8d5076721649f345af7a36f41f47969f (patch)
treeb4151cc8ec8174220d0bd404a68aca137bf67eb1
parent8db69d19e3f3b058a8b8f5755b0f07869cd0fdad (diff)
downloadgitlab-ce-3247f47c8d5076721649f345af7a36f41f47969f.tar.gz
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
-rw-r--r--lib/gitlab/git/repository.rb35
1 files changed, 1 insertions, 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/`.