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
|
break
|
||||||
}
|
}
|
||||||
for _, item := range result.Commits {
|
for _, item := range result.Commits {
|
||||||
name := item.Commit.GetAuthor().GetName()
|
emails := []string{
|
||||||
email := item.Commit.GetAuthor().GetEmail()
|
item.Commit.GetAuthor().GetEmail(),
|
||||||
if utils.SkipResult(name, email) {
|
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
|
continue
|
||||||
}
|
}
|
||||||
if _, seen := results[name+" - "+email]; !seen {
|
if names[i] == "" || emails[i] == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if _, seen := results[names[i]+" - "+emails[i]]; !seen {
|
||||||
author := CommitResult{
|
author := CommitResult{
|
||||||
Name: name,
|
Name: names[i],
|
||||||
Email: email,
|
Email: emails[i],
|
||||||
Occurrences: 1,
|
Occurrences: 1,
|
||||||
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
|
FirstFoundIn: item.GetRepository().Owner.GetLogin() + "/" + item.GetRepository().
|
||||||
GetName(),
|
GetName(),
|
||||||
}
|
}
|
||||||
results[name+" - "+email] = author
|
results[names[i]+" - "+emails[i]] = author
|
||||||
} else {
|
} else if i == 0 {
|
||||||
result := results[name+" - "+email]
|
result := results[names[i]+" - "+emails[i]]
|
||||||
result.Occurrences++
|
result.Occurrences++
|
||||||
results[name+" - "+email] = result
|
results[names[i]+" - "+emails[i]] = result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user