mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Ensure global gitignore file is not loaded in tests
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
var _ = fmt.Print
|
||||
|
||||
type IgnoreFile interface {
|
||||
Len() int // number of rules
|
||||
LoadString(string) error
|
||||
LoadBytes([]byte) error
|
||||
LoadLines(...string) error
|
||||
|
||||
@@ -29,6 +29,8 @@ type Gitignore struct {
|
||||
line_number_offset int
|
||||
}
|
||||
|
||||
func (g Gitignore) Len() int { return len(g.patterns) }
|
||||
|
||||
func (g Gitignore) IsIgnored(relpath string, ftype os.FileMode) (is_ignored bool, linenum_of_matching_rule int, pattern string) {
|
||||
if os.PathSeparator != '/' {
|
||||
relpath = strings.ReplaceAll(relpath, string(os.PathSeparator), "/")
|
||||
|
||||
Reference in New Issue
Block a user