@@ -38,7 +38,7 @@ function api.trim(s)
38
38
return (s :gsub (" ^%s*(.-)%s*$" , " %1" ))
39
39
end
40
40
41
- function api :exec (command , do_caching , target_dir , no_recording )
41
+ function api :exec (command , do_caching , target_dir , no_recording , path_spec )
42
42
local cwd = target_dir or self .cwd
43
43
local cmd = self .executable
44
44
if cwd then
@@ -48,6 +48,16 @@ function api:exec(command, do_caching, target_dir, no_recording)
48
48
if not no_recording then
49
49
api .recorder .record_head (cwd )
50
50
end
51
+ if path_spec then
52
+ if type (path_spec ) == ' table' then
53
+ cmd = cmd .. ' --'
54
+ for _ ,path in ipairs (path_spec ) do
55
+ cmd = cmd .. ' ' .. path
56
+ end
57
+ elseif type (path_spec ) == ' string' then
58
+ cmd = cmd .. ' -- ' .. path_spec
59
+ end
60
+ end
51
61
if do_caching then
52
62
local found , result = cache :seek (cmd )
53
63
if found then
@@ -145,7 +155,7 @@ function api:parse_response(buffer)
145
155
return results
146
156
end
147
157
148
- function api :log (format_spec , revision , options , target_dir )
158
+ function api :log (format_spec , revision , options , target_dir , path_spec )
149
159
local format , err = self :parse_format_spec (format_spec )
150
160
if err then
151
161
return nil , err
@@ -158,7 +168,7 @@ function api:log(format_spec, revision, options, target_dir)
158
168
if revision and revision ~= ' ' then
159
169
cmd = cmd .. ' ' .. revision
160
170
end
161
- local response , err = self :exec (cmd , true , target_dir )
171
+ local response , err = self :exec (cmd , true , target_dir , false , path_spec )
162
172
if not response then
163
173
return nil , err
164
174
end
0 commit comments