summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-04 15:03:16 +0000
committerDouwe Maan <douwe@gitlab.com>2015-11-04 15:03:16 +0000
commit3f05c22f5612c26ff3707aa16eb0f3c8be18ec93 (patch)
treef097723ce5f9eb9b92e32fbb78ae5c578aecea85 /app
parent82aa54193f67b31400f06de372adfc25acc61c0c (diff)
parentd09d62b6b875102b7a334fcf9e689537e1f25013 (diff)
downloadgitlab-ce-3f05c22f5612c26ff3707aa16eb0f3c8be18ec93.tar.gz
Merge branch 'rs-git-bin-path' into 'master'
Replace all usages of `git` command with configurable binary path Closes #3311 See merge request !1742
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 9266ba27f0a..f8c4cb1387b 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -89,7 +89,7 @@ class Repository
def find_commits_by_message(query)
# Limited to 1000 commits for now, could be parameterized?
- args = %W(git log --pretty=%H --max-count 1000 --grep=#{query})
+ args = %W(#{Gitlab.config.git.bin_path} log --pretty=%H --max-count 1000 --grep=#{query})
git_log_results = Gitlab::Popen.popen(args, path_to_repo).first.lines.map(&:chomp)
commits = git_log_results.map { |c| commit(c) }
@@ -296,7 +296,7 @@ class Repository
end
def last_commit_for_path(sha, path)
- args = %W(git rev-list --max-count=1 #{sha} -- #{path})
+ args = %W(#{Gitlab.config.git.bin_path} rev-list --max-count=1 #{sha} -- #{path})
sha = Gitlab::Popen.popen(args, path_to_repo).first.strip
commit(sha)
end
@@ -347,7 +347,7 @@ class Repository
end
def branch_names_contains(sha)
- args = %W(git branch --contains #{sha})
+ args = %W(#{Gitlab.config.git.bin_path} branch --contains #{sha})
names = Gitlab::Popen.popen(args, path_to_repo).first
if names.respond_to?(:split)
@@ -364,7 +364,7 @@ class Repository
end
def tag_names_contains(sha)
- args = %W(git tag --contains #{sha})
+ args = %W(#{Gitlab.config.git.bin_path} tag --contains #{sha})
names = Gitlab::Popen.popen(args, path_to_repo).first
if names.respond_to?(:split)
@@ -505,7 +505,7 @@ class Repository
def search_files(query, ref)
offset = 2
- args = %W(git grep -i -n --before-context #{offset} --after-context #{offset} -e #{query} #{ref || root_ref})
+ args = %W(#{Gitlab.config.git.bin_path} grep -i -n --before-context #{offset} --after-context #{offset} -e #{query} #{ref || root_ref})
Gitlab::Popen.popen(args, path_to_repo).first.scrub.split(/^--$/)
end
@@ -537,7 +537,7 @@ class Repository
end
def fetch_ref(source_path, source_ref, target_ref)
- args = %W(git fetch -f #{source_path} #{source_ref}:#{target_ref})
+ args = %W(#{Gitlab.config.git.bin_path} fetch -f #{source_path} #{source_ref}:#{target_ref})
Gitlab::Popen.popen(args, path_to_repo)
end