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:
authorSean McGivern <sean@gitlab.com>2017-03-28 16:31:13 +0300
committerSean McGivern <sean@gitlab.com>2017-03-30 12:21:19 +0300
commit53819c5ac6a9cdc2309224bf1d8cb5d8d2ad7a2d (patch)
treea89dc6f9051d29f0e7246980f9a3fa11a6ed76ce /lib/gitlab/git
parentad831ace7ed8d2ed999b15f8350aaa51f0490124 (diff)
Support >1 path in Gitlab::Git::Repository#log
This is analogous to `git log -- foo bar baz`, but not the same as `Gitlab::Git::Repository#log(path: 'foo bar baz')`, which would run `git log -- 'foo bar baz'`.
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/repository.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 2187dd70ff4..2193720457b 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -346,7 +346,12 @@ module Gitlab
cmd << "--after=#{options[:after].iso8601}" if options[:after]
cmd << "--before=#{options[:before].iso8601}" if options[:before]
cmd << sha
- cmd += %W[-- #{options[:path]}] if options[:path].present?
+
+ # :path can be a string or an array of strings
+ if options[:path].present?
+ cmd << '--'
+ cmd += Array(options[:path])
+ end
raw_output = IO.popen(cmd) { |io| io.read }
lines = offset_in_ruby ? raw_output.lines.drop(offset) : raw_output.lines