summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Worthe <justin@jemstep.com>2019-12-27 17:23:20 +0200
committerJustin Worthe <justin@jemstep.com>2019-12-27 17:23:20 +0200
commitb1ff1e04aa68ae4b34403414ab85777f12c71844 (patch)
treef0d5478fd5b6741aef97cd345f760dea79c2a8d7
parenteaa986cb2a83bd75d9053366cc6b18df91c03e3e (diff)
Added tags to the list of authors on a branch
-rw-r--r--Cargo.toml2
-rw-r--r--src/logger.rs2
-rw-r--r--src/policies.rs8
3 files changed, 8 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 5e2ccb4..1adeec2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ structopt = "0.3.5"
serde = { version = "1.0.89", features = ["derive"] }
toml = "0.5.5"
serde_json = "1.0.40"
-log = { version = "0.4.7", features = ["std", "serde"] }
+log = { version = "0.4.8", features = ["std", "serde"] }
chrono = "0.4.7"
rayon = "1.0.3"
uuid = { version = "0.8.1", features = ["serde", "v4"] } \ No newline at end of file
diff --git a/src/logger.rs b/src/logger.rs
index 6fff0db..fef886d 100644
--- a/src/logger.rs
+++ b/src/logger.rs
@@ -124,7 +124,7 @@ impl Logger {
pub fn test_init() {
Logger::init(LoggingOpt {
quiet: false,
- verbose: 2,
+ verbose: 0,
log_url: None,
user: None,
ip: None,
diff --git a/src/policies.rs b/src/policies.rs
index cb5adf1..49baf9c 100644
--- a/src/policies.rs
+++ b/src/policies.rs
@@ -282,7 +282,6 @@ fn verify_different_authors<G: Git>(
new_commit_id: Oid,
ref_name: &str,
) -> Result<PolicyResult, Box<dyn Error>> {
- // TODO: Add taggers to this set
let new_branch = old_commit_id.is_zero();
let is_merge = git.is_merge_commit(new_commit_id);
let is_head = git.is_head(ref_name)?;
@@ -302,7 +301,12 @@ fn verify_different_authors<G: Git>(
} else {
let authors: HashSet<_> = commits
.iter()
- .filter_map(|c| c.author_email.clone())
+ .flat_map(|c| {
+ c.tags
+ .iter()
+ .filter_map(|t| t.tagger_email.as_ref())
+ .chain(c.author_email.as_ref())
+ })
.collect();
if authors.len() <= 1 {
error!(