MCPcopy Create free account
hub / github.com/GCWing/BitFun / parse_remote_commits

Function parse_remote_commits

src/apps/desktop/src/api/git_api.rs:279–304  ·  view source on GitHub ↗
(output: &str)

Source from the content-addressed store, hash-verified

277}
278
279fn parse_remote_commits(output: &str) -> Vec<GitCommit> {
280 output
281 .lines()
282 .filter_map(|line| {
283 let mut fields = line.splitn(6, '\t');
284 let hash = fields.next()?.to_string();
285 let short_hash = fields.next()?.to_string();
286 let author = fields.next()?.to_string();
287 let author_email = fields.next()?.to_string();
288 let date = fields.next()?.to_string();
289 let message = fields.next().unwrap_or_default().to_string();
290 Some(GitCommit {
291 hash,
292 short_hash,
293 message,
294 author,
295 author_email,
296 date,
297 parents: Vec::new(),
298 additions: None,
299 deletions: None,
300 files_changed: None,
301 })
302 })
303 .collect()
304}
305
306fn parse_remote_name_status_output(output: &str) -> Vec<GitChangedFile> {
307 output

Callers 1

git_get_commitsFunction · 0.85

Calls 2

collectMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected