aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/gitattributes
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: gitattributes, Avoid index out of rangeToon Claes2022-10-122-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | When a path is deeper than the single asterisk pattern the code would crash with a "index out of range". This change checks the length of the remaining pattern before it references an element of that slice. With a single trailing asterisk paths deeper than the pattern should not get the attributes. For example with the following `.gitattributes` file: thirdparty/* linguist-vendored This is how git handles it: $ git check-attr --all thirdparty/README.md thirdparty/README.md: diff: markdown thirdparty/README.md: linguist-vendored: set $ git check-attr --all thirdparty/package/README.md thirdparty/package/README.md: diff: markdown
* error strings: Don't capitalize, use periods, or newlinesAbhinav Gupta2021-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Per [Go Code Review Comments][1], > Error strings should not be capitalized (unless beginning with proper > nouns or acronyms) or end with punctuation staticcheck's [ST1005][2] also complains about these. For example, ``` object_walker.go:63:10: error strings should not be capitalized (ST1005) object_walker.go:101:10: error strings should not be capitalized (ST1005) object_walker.go:101:10: error strings should not end with punctuation or a newline (ST1005) plumbing/format/commitgraph/file.go:17:26: error strings should not be capitalized (ST1005) ``` This fixes all instances of this issue reported by staticcheck. [1]: https://github.com/golang/go/wiki/CodeReviewComments#error-strings [2]: https://staticcheck.io/docs/checks/#ST1005
* plumbing: format, use os.UserHomeDir()Máximo Cuadros2021-05-022-18/+15
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-102-5/+5
|
* plumbing/format: simplify codeChristian Muehlhaeuser2019-07-291-1/+1
| | | | | | | Just a bit easier to read, in my opinion. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit 91d314ce8f13eff06fd4af8b869cee5a3e2ab014)
* plumbing: format/gitattributes supportArran Walker2019-04-248-0/+1043
Implements gitattributes parsing, matching and attribute extraction. Signed-off-by: Arran Walker <arran.walker@fiveturns.org>