Internal implementation of fixing file write flags with precompiled filters
(absPath, workingDir string, lockable, unlockable *filepathfilter.Filter)
| 111 | |
| 112 | // Internal implementation of fixing file write flags with precompiled filters |
| 113 | func (c *Client) fixFileWriteFlags(absPath, workingDir string, lockable, unlockable *filepathfilter.Filter) error { |
| 114 | |
| 115 | // Build a list of files |
| 116 | lsFiles, err := git.NewLsFiles(workingDir, !c.ModifyIgnoredFiles, false) |
| 117 | if err != nil { |
| 118 | return err |
| 119 | } |
| 120 | |
| 121 | for f := range lsFiles.Files { |
| 122 | err = c.fixSingleFileWriteFlags(f, lockable, unlockable) |
| 123 | if err != nil { |
| 124 | return err |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | return nil |
| 129 | } |
| 130 | |
| 131 | // FixLockableFileWriteFlags checks each file in the provided list, and for |
| 132 | // those which are lockable, makes sure their write flags are set correctly |
no test coverage detected