@@ -8,7 +8,7 @@ local utils = require("diffview.utils")
88local M = {}
99
1010--- @class CommitLogPanel : Panel
11- --- @field git_toplevel string
11+ --- @field adapter VCSAdapter
1212--- @field args string[]
1313--- @field job_out string[]
1414local CommitLogPanel = oop .create_class (" CommitLogPanel" , Panel )
4747--- @field args string[]
4848--- @field name string
4949
50- --- @param git_toplevel string
50+ --- @param adapter VCSAdapter
5151--- @param opt CommitLogPanelSpec
52- function CommitLogPanel :init (git_toplevel , opt )
52+ function CommitLogPanel :init (adapter , opt )
5353 CommitLogPanel :super ().init (self , {
5454 bufname = opt .name ,
5555 config = opt .config or get_user_config ().commit_log_panel .win_config ,
5656 })
5757
58- self .git_toplevel = git_toplevel
58+ self .adapter = adapter
5959 self .args = opt .args or { " -n256" }
6060
6161 self :on_autocmd (" BufWinEnter" , {
@@ -73,14 +73,9 @@ CommitLogPanel.update = async.void(function(self, args)
7373 end
7474
7575 Job :new ({
76- command = " git" ,
77- args = utils .vec_join (
78- " log" ,
79- " --first-parent" ,
80- " --stat" ,
81- args or self .args
82- ),
83- cwd = self .git_toplevel ,
76+ command = self .adapter :bin (),
77+ args = self .adapter :get_log_args (args or self .args ),
78+ cwd = self .adapter .ctx .toplevel ,
8479 on_exit = vim .schedule_wrap (function (job )
8580 if job .code ~= 0 then
8681 utils .err (" Failed to open log!" )
0 commit comments