diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-05-29 14:54:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 14:54:56 +0100 |
commit | d37c8b92eb84a2b66413262c33812236b91422f9 (patch) | |
tree | be9813590b4354abcf1e1933e546ec2f24c972be /plumbing/format/gitignore/pattern.go | |
parent | 044ba2fc8e8de0f00a6a0729b369b9e93d87e712 (diff) | |
parent | 80d5f724674280d81f9163d9a33de9ef0c72c61c (diff) | |
download | go-git-d37c8b92eb84a2b66413262c33812236b91422f9.tar.gz |
Merge pull request #781 from AriehSchneier/fix-gitignore
plumbing: gitignore, fix incorrect parsing. Fixes #500
Diffstat (limited to 'plumbing/format/gitignore/pattern.go')
-rw-r--r-- | plumbing/format/gitignore/pattern.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plumbing/format/gitignore/pattern.go b/plumbing/format/gitignore/pattern.go index 098cb50..450b3cd 100644 --- a/plumbing/format/gitignore/pattern.go +++ b/plumbing/format/gitignore/pattern.go @@ -39,6 +39,8 @@ type pattern struct { // ParsePattern parses a gitignore pattern string into the Pattern structure. func ParsePattern(p string, domain []string) Pattern { + // storing domain, copy it to ensure it isn't changed externally + domain = append([]string(nil), domain...) res := pattern{domain: domain} if strings.HasPrefix(p, inclusionPrefix) { |