@@ -224,27 +224,24 @@ end
224224
225225local get_depth = function (plugin )
226226 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'
229228 else
230229 local depth = plugin .commit and 999999 or config .depth
231- return fmt (' --depth="%s"' , depth )
230+ return fmt (' --depth="%s"' , depth )
232231 end
233232end
234233
235234git .setup = function (plugin )
235+ local depth_opt = get_depth (plugin )
236236 local plugin_name = util .get_plugin_full_name (plugin )
237237 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+' )
240239
241240 local submodule_cmd = config .exec_cmd .. config .subcommands .submodules
242241 local rev_cmd = config .exec_cmd .. config .subcommands .get_rev
243242
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+' )
248245
249246 local branch_cmd = config .exec_cmd .. config .subcommands .current_branch
250247 local current_commit_cmd = vim .split (config .exec_cmd .. config .subcommands .get_header , ' %s+' )
@@ -441,6 +438,8 @@ git.setup = function(plugin)
441438
442439 disp :task_update (plugin_name , ' pulling updates...' )
443440
441+ local commit = plugin .commit or get_lockfile_info (plugin ).commit
442+ local update_cmd = commit and fetch_cmd or pull_cmd
444443 r
445444 :and_then (await , jobs .run (update_cmd , update_opts ))
446445 :and_then (await , jobs .run (submodule_cmd , update_opts ))
0 commit comments