diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-01-12 18:27:33 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-01-12 18:27:33 +0000 |
commit | 3eebca7b5c8af599d4aec6f2b5b4905408079754 (patch) | |
tree | df1e92a264836c19fb70f4d3d454124b9ee8758c /lib | |
parent | 764fc0dd69b3e064d4b14ce8125fbb6daa98cf7f (diff) | |
parent | 22a34c81aa3801e5b453fd2c0a9364917e0aedbe (diff) | |
download | gitlab-ce-3eebca7b5c8af599d4aec6f2b5b4905408079754.tar.gz |
Merge branch 'use-configured-git' into 'master'
Use configured git rather thans system git
See merge request !8460
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/blame.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/git/repository.rb | 6 | ||||
-rw-r--r-- | lib/tasks/gitlab/git.rake | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/gitlab/git/blame.rb b/lib/gitlab/git/blame.rb index 46f3969b6e1..2913230e979 100644 --- a/lib/gitlab/git/blame.rb +++ b/lib/gitlab/git/blame.rb @@ -27,7 +27,7 @@ module Gitlab private def load_blame - cmd = %W(git --git-dir=#{@repo.path} blame -p #{@sha} -- #{@path}) + cmd = %W(#{Gitlab.config.git.bin_path} --git-dir=#{@repo.path} blame -p #{@sha} -- #{@path}) # Read in binary mode to ensure ASCII-8BIT raw_output = IO.popen(cmd, 'rb') {|io| io.read } output = encode_utf8(raw_output) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 963b326a730..79b23d59b3a 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -332,7 +332,7 @@ module Gitlab end def log_by_shell(sha, options) - cmd = %W(git --git-dir=#{path} log) + cmd = %W(#{Gitlab.config.git.bin_path} --git-dir=#{path} log) cmd += %W(-n #{options[:limit].to_i}) cmd += %w(--format=%H) cmd += %W(--skip=#{options[:offset].to_i}) @@ -913,7 +913,7 @@ module Gitlab return [] end - cmd = %W(git --git-dir=#{path} ls-tree) + cmd = %W(#{Gitlab.config.git.bin_path} --git-dir=#{path} ls-tree) cmd += %w(-r) cmd += %w(--full-tree) cmd += %w(--full-name) @@ -1108,7 +1108,7 @@ module Gitlab end def archive_to_file(treeish = 'master', filename = 'archive.tar.gz', format = nil, compress_cmd = %w(gzip -n)) - git_archive_cmd = %W(git --git-dir=#{path} archive) + git_archive_cmd = %W(#{Gitlab.config.git.bin_path} --git-dir=#{path} archive) # Put files into a directory before archiving prefix = "#{archive_name(treeish)}/" diff --git a/lib/tasks/gitlab/git.rake b/lib/tasks/gitlab/git.rake index f9834a4dae8..a67c1fe1f27 100644 --- a/lib/tasks/gitlab/git.rake +++ b/lib/tasks/gitlab/git.rake @@ -3,7 +3,7 @@ namespace :gitlab do desc "GitLab | Git | Repack" task repack: :environment do - failures = perform_git_cmd(%W(git repack -a --quiet), "Repacking repo") + failures = perform_git_cmd(%W(#{Gitlab.config.git.bin_path} repack -a --quiet), "Repacking repo") if failures.empty? puts "Done".color(:green) else @@ -13,17 +13,17 @@ namespace :gitlab do desc "GitLab | Git | Run garbage collection on all repos" task gc: :environment do - failures = perform_git_cmd(%W(git gc --auto --quiet), "Garbage Collecting") + failures = perform_git_cmd(%W(#{Gitlab.config.git.bin_path} gc --auto --quiet), "Garbage Collecting") if failures.empty? puts "Done".color(:green) else output_failures(failures) end end - + desc "GitLab | Git | Prune all repos" task prune: :environment do - failures = perform_git_cmd(%W(git prune), "Git Prune") + failures = perform_git_cmd(%W(#{Gitlab.config.git.bin_path} prune), "Git Prune") if failures.empty? puts "Done".color(:green) else |