Skip to content

Commit

Permalink
chore: Adds e-mail to affiliated concern reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mchernicoff authored and alilleybrinker committed Nov 8, 2024
1 parent e00e34d commit 468e99a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hipcheck/src/source/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn checkout(repo_path: &Path, refspec: Option<String>) -> HcResult<String> {
}
},
};

repo.set_head_detached_from_annotated(tgt_ref)?;
ret_str = refspec_str;
} else {
Expand Down
13 changes: 11 additions & 2 deletions plugins/affiliation/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ async fn affiliation(engine: &mut PluginEngine, key: Target) -> Result<Vec<bool>
// then add the contributor's name and its commit count to the contributor frequency hash map
for contributor_view in contributor_views {
let count = contributor_view.commits.len();
contributor_freq_map.insert(contributor_view.contributor.name, count);
contributor_freq_map.insert(
format!(
"{} ({})",
contributor_view.contributor.name, contributor_view.contributor.email
),
count,
);
}

let all_contributors_value = engine
Expand Down Expand Up @@ -639,6 +645,9 @@ mod test {
assert_eq!(output.len(), 2);
let num_affiliated = output.iter().filter(|&n| *n).count();
assert_eq!(num_affiliated, 1);
assert_eq!(concerns[0], "Contributor Jane Doe has count 2")
assert_eq!(
concerns[0],
"Contributor Jane Doe ([email protected]) has count 2"
)
}
}
5 changes: 1 addition & 4 deletions plugins/affiliation/test/example_orgs.kdl
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
strategy "independent" {
country "United States"
org "MITRE"
}
strategy "independent"
orgs {
org "AT&T" country="United States" {
host "att.com"
Expand Down

0 comments on commit 468e99a

Please sign in to comment.