fix apidiff to not include *api packages
@@ -113,6 +113,7 @@ func getRepoContentForCommit(wt repo.WorkingTree, dir, commit string) (r repoCon
if err != nil {
return err
}
+ var skipDir error
if info.IsDir() {
// check if leaf dir
fi, err := ioutil.ReadDir(path)
@@ -121,7 +122,7 @@ func getRepoContentForCommit(wt repo.WorkingTree, dir, commit string) (r repoCon
}
hasSubDirs := false
for _, f := range fi {
- // check if this is the interfaces subdir, if it is don't recurse into it
+ // check if this is the interfaces subdir, if it is don't count it as a subdir
if f.IsDir() && f.Name() != filepath.Base(path)+apiDirSuffix {
hasSubDirs = true
break
@@ -129,9 +130,11 @@ func getRepoContentForCommit(wt repo.WorkingTree, dir, commit string) (r repoCon
}
if !hasSubDirs {
pkgDirs = append(pkgDirs, path)
+ // skip any dirs under us (i.e. interfaces subdir)
+ skipDir = filepath.SkipDir
}
}
- return nil
+ return skipDir
})
if err != nil {
return
