mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
fix(deps): update module github.com/vbatts/git-validation to v1.2.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
26
test/tools/vendor/github.com/vbatts/git-validation/git/commits.go
generated
vendored
26
test/tools/vendor/github.com/vbatts/git-validation/git/commits.go
generated
vendored
@ -57,7 +57,7 @@ func checkRevList(commitrange string) (string, error) {
|
||||
// no issues, return now
|
||||
return commitrange, nil
|
||||
}
|
||||
cmdArgs = []string{"git", "log", "--pretty=oneline"}
|
||||
cmdArgs = []string{"git", "log", "--pretty=oneline", "--no-show-signature"}
|
||||
if debug() {
|
||||
logrus.Infof("[git] cmd: %q", strings.Join(cmdArgs, " "))
|
||||
}
|
||||
@ -135,6 +135,15 @@ func gitVersionNewerThan(otherV string) (bool, error) {
|
||||
// Check warns if changes introduce whitespace errors.
|
||||
// Returns non-zero if any issues are found.
|
||||
func Check(commit string) ([]byte, error) {
|
||||
logs, err := LogUntil(commit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(logs) == 1 {
|
||||
logrus.Debugf("[git.Check] %q is the initial commit. Skipping.", commit)
|
||||
return []byte{}, nil
|
||||
}
|
||||
|
||||
args := []string{
|
||||
"--no-pager", "log", "--check",
|
||||
fmt.Sprintf("%s^..%s", commit, commit),
|
||||
@ -178,6 +187,21 @@ func Show(commit string) ([]byte, error) {
|
||||
// See also FieldNames
|
||||
type CommitEntry map[string]string
|
||||
|
||||
// LogUntil returns the array of oneline commits from initial until the provided commit
|
||||
func LogUntil(commit string) ([]string, error) {
|
||||
cmd := exec.Command("git", "--no-pager", "log", "--oneline", "--no-show-signature", commit)
|
||||
if debug() {
|
||||
logrus.Infof("[git] cmd: %q", strings.Join(cmd.Args, " "))
|
||||
}
|
||||
cmd.Stderr = os.Stderr
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
logrus.Errorf("[git] cmd: %q", strings.Join(cmd.Args, " "))
|
||||
return nil, err
|
||||
}
|
||||
return strings.Split(strings.TrimSpace(string(out)), "\n"), nil
|
||||
}
|
||||
|
||||
// LogCommit assembles the full information on a commit from its commit hash
|
||||
func LogCommit(commit string) (*CommitEntry, error) {
|
||||
c := CommitEntry{}
|
||||
|
Reference in New Issue
Block a user