mirror of
https://github.com/anotherhadi/github-recon.git
synced 2026-10-05 10:58:25 +02:00
Now read from Commit.Committer, Committer & Author
Signed-off-by: Hadi <[email protected]>
This commit is contained in:
@@ -39,24 +39,41 @@ func Commits(s github_recon_settings.Settings) (response CommitsResult) {
|
||||
break
|
||||
}
|
||||
for _, item := range result.Commits {
|
||||
name := item.Commit.GetAuthor().GetName()
|
||||
email := item.Commit.GetAuthor().GetEmail()
|
||||
if utils.SkipResult(name, email) {
|
||||
emails := []string{
|
||||
item.Commit.GetAuthor().GetEmail(),
|
||||
item.Commit.GetCommitter().GetEmail(),
|
||||
item.GetAuthor().GetEmail(),
|
||||
item.GetCommitter().GetEmail(),
|
||||
}
|
||||
|
||||
names := []string{
|
||||
item.Commit.GetAuthor().GetName(),
|
||||
item.Commit.GetCommitter().GetName(),
|
||||
item.GetAuthor().GetName(),
|
||||
item.GetCommitter().GetName(),
|
||||
}
|
||||
|
||||
for i := range names {
|
||||
if utils.SkipResult(names[i], emails[i]) {
|
||||
continue
|
||||
}
|
||||
if _, seen := results[name+" - "+email]; !seen {
|
||||
if names[i] == "" || emails[i] == "" {
|
||||
continue
|
||||
}
|
||||
if _, seen := results[names[i]+" - "+emails[i]]; !seen {
|
||||
author := CommitResult{
|
||||
Name: name,
|
||||
Email: email,
|
||||
Name: names[i],
|
||||
Email: emails[i],
|
||||
Occurrences: 1,
|
||||
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
|
||||
GetName(),
|
||||
}
|
||||
results[name+" - "+email] = author
|
||||
} else {
|
||||
result := results[name+" - "+email]
|
||||
results[names[i]+" - "+emails[i]] = author
|
||||
} else if i == 0 {
|
||||
result := results[names[i]+" - "+emails[i]]
|
||||
result.Occurrences++
|
||||
results[name+" - "+email] = result
|
||||
results[names[i]+" - "+emails[i]] = result
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user