mirror of https://github.com/perkeep/perkeep.git
devcam hook: correct pathspec for older gits
Older git versions (prior to 2.13 / commit
859b7f1d0e
)
required a more explicit pattern.
This also reorders the gofmt one to put the positive before the negative
match for consistency.
Fixes #1191
Change-Id: Ie74e3c3d434f667d76d5ebbb76811b4f304800c8
This commit is contained in:
parent
887e87845b
commit
feef4b6b0d
|
@ -237,7 +237,7 @@ func (c *hookCmd) hookGofmt() error {
|
|||
|
||||
func (c *hookCmd) hookTrailingSpace() error {
|
||||
// see 'pathspec' for the ':!' syntax to ignore a directory.
|
||||
out, _ := cmdOutputDirErr(".", "git", "diff-index", "--check", "--diff-filter=ACM", "--cached", "HEAD", "--", ":!/vendor/")
|
||||
out, _ := cmdOutputDirErr(".", "git", "diff-index", "--check", "--diff-filter=ACM", "--cached", "HEAD", "--", ".", ":!/vendor/")
|
||||
if out != "" {
|
||||
printf("\n%s", out)
|
||||
printf("Trailing whitespace detected, you need to clean it up manually.\n")
|
||||
|
@ -257,7 +257,7 @@ func (c *hookCmd) runGofmt() (files []string, err error) {
|
|||
repo += string(filepath.Separator)
|
||||
}
|
||||
|
||||
out, err := cmdOutputDirErr(".", "git", "diff-index", "--name-only", "--diff-filter=ACM", "--cached", "HEAD", "--", ":!/vendor/", ":(glob)**/*.go")
|
||||
out, err := cmdOutputDirErr(".", "git", "diff-index", "--name-only", "--diff-filter=ACM", "--cached", "HEAD", "--", ":(glob)**/*.go", ":!/vendor/")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue