pr: Detect port renames

This commit is contained in:
Zero King
2019-01-06 02:27:04 +00:00
parent 98fa1eff64
commit 01717a2738
+8 -1
View File
@@ -35,7 +35,14 @@ func (client *githubClient) ListChangedPortsAndFiles(owner, repo string, number
portfileRegexp := regexp.MustCompile(`[^\._/][^/]*/([^/]+)/Portfile`) // Ignore hidden and _* top directories
for _, file := range allFiles {
if match := portfileRegexp.FindStringSubmatch(*file.Filename); match != nil {
match := portfileRegexp.FindStringSubmatch(*file.Filename)
if match != nil {
if *file.Status == "renamed" {
match = portfileRegexp.FindStringSubmatch(*file.PreviousFilename)
if match == nil {
continue
}
}
ports = append(ports, match[1])
commitFiles = append(commitFiles, file)
}