@@ -224,27 +224,24 @@ end
224
224
225
225
local get_depth = function (plugin )
226
226
if config .is_lockfile then
227
- local info = lockfile .get (plugin .short_name )
228
- return info .date and fmt (' --shallow-since="%s"' , info .date ) or ' --depth=999999'
227
+ return info .date and fmt (' --shallow-since="%s"' , info .date ) or ' --depth=999999'
229
228
else
230
229
local depth = plugin .commit and 999999 or config .depth
231
- return fmt (' --depth="%s"' , depth )
230
+ return fmt (' --depth="%s"' , depth )
232
231
end
233
232
end
234
233
235
234
git .setup = function (plugin )
235
+ local depth_opt = get_depth (plugin )
236
236
local plugin_name = util .get_plugin_full_name (plugin )
237
237
local install_to = plugin .install_path
238
- local install_cmd = vim .split (config .exec_cmd .. config .subcommands .install , ' %s+' )
239
- install_cmd [# install_cmd + 1 ] = get_depth (plugin )
238
+ local install_cmd = vim .split (config .exec_cmd .. config .subcommands .install .. depth_opt , ' %s+' )
240
239
241
240
local submodule_cmd = config .exec_cmd .. config .subcommands .submodules
242
241
local rev_cmd = config .exec_cmd .. config .subcommands .get_rev
243
242
244
- local use_fetch = config .is_lockfile or plugin .commit or plugin .tag
245
- local update_subcmd = use_fetch and config .subcommands .fetch or config .subcommands .update
246
- local update_cmd = vim .split (config .exec_cmd .. update_subcmd , ' %s+' )
247
- update_cmd [# update_cmd + 1 ] = get_depth (plugin )
243
+ local fetch_cmd = vim .split (config .exec_cmd .. config .subcommands .fetch .. depth_opt , ' %s+' )
244
+ local pull_cmd = vim .split (config .exec_cmd .. config .subcommands .update .. depth_opt , ' %s+' )
248
245
249
246
local branch_cmd = config .exec_cmd .. config .subcommands .current_branch
250
247
local current_commit_cmd = vim .split (config .exec_cmd .. config .subcommands .get_header , ' %s+' )
@@ -441,6 +438,8 @@ git.setup = function(plugin)
441
438
442
439
disp :task_update (plugin_name , ' pulling updates...' )
443
440
441
+ local commit = plugin .commit or get_lockfile_info (plugin ).commit
442
+ local update_cmd = commit and fetch_cmd or pull_cmd
444
443
r
445
444
:and_then (await , jobs .run (update_cmd , update_opts ))
446
445
:and_then (await , jobs .run (submodule_cmd , update_opts ))
0 commit comments