diff

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package diff provides functionality to check if files in a module set have changed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasChanged

func HasChanged(repoRoot string, versioningFile string, ver string, modset string) ([]string, error)

HasChanged checks if the files in the module set have changed since the last release.

Types

type Client added in v0.10.0

type Client interface {
	HeadCommit(r *git.Repository) (*object.Commit, error)
	TagCommit(r *git.Repository, tag string) (*object.Commit, error)
	FilesChanged(headCommit *object.Commit, tagCommit *object.Commit, prefix string, suffix string) ([]string, error)
}

Client is an interface for a git client. It is used to abstract away the implementation details of the git client, allowing for easier testing and mocking.

type GitClient added in v0.10.0

type GitClient struct{}

GitClient handles interactions with git.

func (GitClient) FilesChanged added in v0.10.0

func (g GitClient) FilesChanged(headCommit *object.Commit, tagCommit *object.Commit, prefix string, suffix string) ([]string, error)

FilesChanged returns a list of files that have changed between two commits.

func (GitClient) HeadCommit added in v0.10.0

func (g GitClient) HeadCommit(r *git.Repository) (*object.Commit, error)

HeadCommit returns the commit object for the HEAD of the repository.

func (GitClient) TagCommit added in v0.10.0

func (g GitClient) TagCommit(r *git.Repository, tag string) (*object.Commit, error)

TagCommit returns the commit object for a given tag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL