Internal function to repopulate lockable patterns You must have locked the c.lockableMutex in the caller
()
| 39 | // Internal function to repopulate lockable patterns |
| 40 | // You must have locked the c.lockableMutex in the caller |
| 41 | func (c *Client) refreshLockablePatterns() { |
| 42 | paths := git.GetAttributePaths(gitattr.NewMacroProcessor(), c.LocalWorkingDir, c.LocalGitDir) |
| 43 | // Always make non-nil even if empty |
| 44 | c.lockablePatterns = make([]string, 0, len(paths)) |
| 45 | for _, p := range paths { |
| 46 | if p.Lockable { |
| 47 | c.lockablePatterns = append(c.lockablePatterns, filepath.ToSlash(p.Path)) |
| 48 | } |
| 49 | } |
| 50 | c.lockableFilter = filepathfilter.New(c.lockablePatterns, nil, filepathfilter.GitAttributes, filepathfilter.DefaultValue(false)) |
| 51 | } |
| 52 | |
| 53 | // IsFileLockable returns whether a specific file path is marked as Lockable, |
| 54 | // ie has the 'lockable' attribute in .gitattributes |
no test coverage detected