Fix repo update choking on duplicated parents
This commit is contained in:
parent
b26ab8feff
commit
5871b19f8e
3 changed files with 15 additions and 13 deletions
|
|
@ -97,8 +97,10 @@ async fn insert_new_commit_links(conn: &mut SqliteConnection, new: &[Info]) -> a
|
|||
let child = commit.id.to_string();
|
||||
for parent in &commit.parent_ids {
|
||||
let parent = parent.to_string();
|
||||
// Commits *cough*linuxkernel*cough* may list the same parent
|
||||
// multiple times, so we just ignore duplicates during insert.
|
||||
sqlx::query!(
|
||||
"INSERT INTO commit_links (parent, child) VALUES (?, ?)",
|
||||
"INSERT OR IGNORE INTO commit_links (parent, child) VALUES (?, ?)",
|
||||
parent,
|
||||
child
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue