mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Refactor changeset spanning function naming
This commit is contained in:
@@ -235,7 +235,7 @@ func PullRequestSpanningPathList(repository GitHubService, pullrequest int, path
|
||||
|
||||
spanningChangesExist := false
|
||||
for _, changeset := range changesets {
|
||||
if ChangesetSpanningPathList(changeset, paths) {
|
||||
if changeset.isSpanningPaths(paths) {
|
||||
// When detecting the first spanning changeset print a prefix message
|
||||
if !spanningChangesExist {
|
||||
fmt.Printf("Spanning changesets detected in the following commits:\n\n")
|
||||
@@ -250,9 +250,9 @@ func PullRequestSpanningPathList(repository GitHubService, pullrequest int, path
|
||||
return spanningChangesExist, changesets, nil
|
||||
}
|
||||
|
||||
// ChangesetSpanningPathList tests if a changeset is spanning
|
||||
// isSpanningPaths tests if a changeset is spanning
|
||||
// multiple directory paths.
|
||||
func ChangesetSpanningPathList(changeset *Changeset, paths []string) bool {
|
||||
func (changeset *Changeset) isSpanningPaths(paths []string) bool {
|
||||
matchedPath := ""
|
||||
|
||||
for _, file := range changeset.files {
|
||||
|
||||
@@ -260,7 +260,7 @@ func TestIsChangesetSpanning(t *testing.T) {
|
||||
|
||||
changeset := &Changeset{files: tt.changeset}
|
||||
|
||||
result := ChangesetSpanningPathList(changeset, tt.files)
|
||||
result := changeset.isSpanningPaths(tt.files)
|
||||
|
||||
if result != tt.expected {
|
||||
t.Errorf("got %t, want %t", result, tt.expected)
|
||||
|
||||
Reference in New Issue
Block a user