如何将身份验证回调传递给git2::Repository::clone()
? (set_remote_callbacks
设置回调)。
我有一些类似以下的代码:
let mut cb = git2::RemoteCallbacks::new();
Self::set_remote_callbacks(&mut cb);
let rr = Repository::clone(url, path.to_str().ok_or("bad string".to_string())?);
例如,我想要的东西是在获取时执行的,它将回调传递给fetch
:
let mut fetchOptions = FetchOptions::new();
let mut cb = git2::RemoteCallbacks::new();
Self::set_remote_callbacks(&mut cb);
fetchOptions.remote_callbacks(cb);
let mut remote = self.repo.find_remote(remote)?;
remote.fetch(&[branch], Some(&mut fetchOptions), None)?;
答案 0 :(得分:0)
使用SELECT *
FROM `random$table`
LEFT JOIN users AS u AND u.username AS title ON u.rank > 4
WHERE u.username = 'exploit'
GROUP BY `id` LIMIT 1
。