Refactor candidate collection in run_manual_rewrite_job to use dedicated filtering for hashes lacking identity mapping
This commit is contained in:
@@ -2925,6 +2925,15 @@ fn run_manual_rewrite_job(
|
|||||||
.filter_map(|hash| resolve_commit_hash(&folder_path, hash))
|
.filter_map(|hash| resolve_commit_hash(&folder_path, hash))
|
||||||
.filter_map(|hash| identities_before.get(&hash).cloned())
|
.filter_map(|hash| identities_before.get(&hash).cloned())
|
||||||
.collect();
|
.collect();
|
||||||
|
let queued_without_identity: Vec<String> = queued_before
|
||||||
|
.iter()
|
||||||
|
.filter(|hash| {
|
||||||
|
resolve_commit_hash(&folder_path, hash)
|
||||||
|
.and_then(|resolved| identities_before.get(&resolved))
|
||||||
|
.is_none()
|
||||||
|
})
|
||||||
|
.cloned()
|
||||||
|
.collect();
|
||||||
|
|
||||||
let mut successful_messages = HashMap::new();
|
let mut successful_messages = HashMap::new();
|
||||||
let mut llm_failures: Vec<(String, String)> = Vec::new();
|
let mut llm_failures: Vec<(String, String)> = Vec::new();
|
||||||
@@ -2999,11 +3008,7 @@ fn run_manual_rewrite_job(
|
|||||||
.iter()
|
.iter()
|
||||||
.filter_map(|identity| identities_after.get(identity).cloned())
|
.filter_map(|identity| identities_after.get(identity).cloned())
|
||||||
.collect();
|
.collect();
|
||||||
for queued in &queued_before {
|
candidates.extend(queued_without_identity);
|
||||||
if resolve_commit_hash(&folder_path, queued).is_none() {
|
|
||||||
candidates.push(queued.clone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if scope == "pending" || history_error.is_some() {
|
if scope == "pending" || history_error.is_some() {
|
||||||
candidates = pending_rewrite_hashes(&folder_path, &candidates);
|
candidates = pending_rewrite_hashes(&folder_path, &candidates);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user