(&self, conn: &Connection, repo: &mut GitRepo)
| 11 | } |
| 12 | |
| 13 | fn populate(&self, conn: &Connection, repo: &mut GitRepo) -> Result<()> { |
| 14 | let mut stmt = conn.prepare( |
| 15 | r#" |
| 16 | INSERT INTO commit_parents (commit_id, parent_id, parent_index, repo) |
| 17 | VALUES (?1, ?2, ?3, ?4) |
| 18 | "#, |
| 19 | )?; |
| 20 | |
| 21 | let repo_path = repo.path().to_string(); |
| 22 | |
| 23 | for commit_result in repo.walk_commits()? { |
| 24 | let commit = commit_result?; |
| 25 | let commit_id = commit.id().to_string(); |
| 26 | |
| 27 | for (index, parent) in commit.parents().enumerate() { |
| 28 | let parent_id = parent.id().to_string(); |
| 29 | stmt.execute((&commit_id, &parent_id, index as i64, &repo_path))?; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | Ok(()) |
| 34 | } |
| 35 | } |
nothing calls this directly
no test coverage detected