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:
authorGabriel Mazetto <brodock@gmail.com>2017-05-31 12:32:11 +0300
committerGabriel Mazetto <brodock@gmail.com>2017-05-31 15:33:03 +0300
commitd219f9a691973708f70d9517765a2ec926d6d903 (patch)
tree9c60270e7bdd60cf40c21260d94f11a8bc1ae506 /lib/tasks/gitlab/task_helpers.rb
parent23f9e95e8a7dfa3371f0c60a90a4cffc300c0f72 (diff)
Fix BasicExecutor specs
Diffstat (limited to 'lib/tasks/gitlab/task_helpers.rb')
-rw-r--r--lib/tasks/gitlab/task_helpers.rb27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/tasks/gitlab/task_helpers.rb b/lib/tasks/gitlab/task_helpers.rb
index e2307e41be1..964aa0fe1bc 100644
--- a/lib/tasks/gitlab/task_helpers.rb
+++ b/lib/tasks/gitlab/task_helpers.rb
@@ -98,6 +98,17 @@ module Gitlab
end
end
+ def gitlab_user
+ Gitlab.config.gitlab.user
+ end
+
+ def is_gitlab_user?
+ return @is_gitlab_user unless @is_gitlab_user.nil?
+
+ current_user = run_command(%w(whoami)).chomp
+ @is_gitlab_user = current_user == gitlab_user
+ end
+
def warn_user_is_not_gitlab
return if @warned_user_not_gitlab
@@ -114,22 +125,6 @@ module Gitlab
end
end
- # Tries to configure git itself
- #
- # Returns true if all subcommands were successfull (according to their exit code)
- # Returns false if any or all subcommands failed.
- def auto_fix_git_config(options)
- if !@warned_user_not_gitlab
- command_success = options.map do |name, value|
- system(*%W(#{Gitlab.config.git.bin_path} config --global #{name} #{value}))
- end
-
- command_success.all?
- else
- false
- end
- end
-
def all_repos
Gitlab.config.repositories.storages.each_value do |repository_storage|
IO.popen(%W(find #{repository_storage['path']} -mindepth 2 -maxdepth 2 -type d -name *.git)) do |find|