diff options
author | Fedor Korotkov <fedor.korotkov@gmail.com> | 2018-08-19 11:51:21 -0400 |
---|---|---|
committer | Fedor Korotkov <fedor.korotkov@gmail.com> | 2018-08-19 11:51:21 -0400 |
commit | 7b4a8379327653167e87e9e46a2d397f8fd9cfc8 (patch) | |
tree | 50ac00b7d3f271ed6e17a45e69390ed57eab02c8 /plumbing/format/gitignore/pattern.go | |
parent | 7b6c1266556f59ac436fada3fa6106d4a84f9b56 (diff) | |
download | go-git-7b4a8379327653167e87e9e46a2d397f8fd9cfc8.tar.gz |
Fixed an edge case for .gitignore
Fixes #923
Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
Diffstat (limited to 'plumbing/format/gitignore/pattern.go')
-rw-r--r-- | plumbing/format/gitignore/pattern.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plumbing/format/gitignore/pattern.go b/plumbing/format/gitignore/pattern.go index 2603352..098cb50 100644 --- a/plumbing/format/gitignore/pattern.go +++ b/plumbing/format/gitignore/pattern.go @@ -133,6 +133,9 @@ func (p *pattern) globMatch(path []string, isDir bool) bool { } else if match { matched = true break + } else if len(path) == 0 { + // if nothing left then fail + matched = false } } } else { |