mirror of
https://github.com/macports/mpbot-github.git
synced 2026-07-13 03:18:39 -07:00
pr: Detect port renames
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user