aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/gitattributes/pattern.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/gitattributes/pattern.go')
-rw-r--r--plumbing/format/gitattributes/pattern.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plumbing/format/gitattributes/pattern.go b/plumbing/format/gitattributes/pattern.go
index d961aba..f101f47 100644
--- a/plumbing/format/gitattributes/pattern.go
+++ b/plumbing/format/gitattributes/pattern.go
@@ -52,6 +52,11 @@ func (p *pattern) Match(path []string) bool {
var match, doublestar bool
var err error
for _, part := range path {
+ // path is deeper than pattern
+ if len(pattern) == 0 {
+ return false
+ }
+
// skip empty
if pattern[0] == "" {
pattern = pattern[1:]