code: func (c *Client) FixFileWriteFlagsInDir(dir string, lockablePatterns, unlockablePatterns []string) error {
  
  	// early-out if no patterns
  	if len(lockablePatterns) == 0 && len(unlockablePatterns) == 0 {
  		return nil
  	}
  
  	absPath := dir
  	if !filepath.IsAbs(dir) {
  		absPath = filepath.Join(c.LocalWorkingDir, dir)
  	}
  	stat, err := os.Stat(absPath)
  	if err != nil {
  		return err
  	}
  	if !stat.IsDir() {
  		return fmt.Errorf("%q is not a valid directory", dir)
  	}
  
  	var lockableFilter *filepathfilter.Filter
  	var unlockableFilter *filepathfilter.Filter
  	if lockablePatterns != nil {
  		lockableFilter = filepathfilter.New(lockablePatterns, nil)
  	}
  	if unlockablePatterns != nil {
  		unlockableFilter = filepathfilter.New(unlockablePatterns, nil)
  	}
  
  	return c.fixFileWriteFlags(absPath, c.LocalWorkingDir, lockableFilter, unlockableFilter)
  }
docs: // FixFileWriteFlagsInDir scans dir (which can either be a relative dir
  // from the root of the repo, or an absolute dir within the repo) looking for
  // files to change permissions for.
  // If lockablePatterns is non-nil, then any file matching those patterns will be
  // checked to see if it is currently locked by the current committer, and if so
  // it will be writeable, and if not locked it will be read-only.
  // If unlockablePatterns is non-nil, then any file matching those patterns will
  // be made writeable if it is not already. This can be used to reset files to
  // writeable when their 'lockable' attribute is turned off.