MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / FixLockableFileWriteFlags

Method FixLockableFileWriteFlags

locking/lockable.go:139–154  ·  view source on GitHub ↗

FixLockableFileWriteFlags checks each file in the provided list, and for those which are lockable, makes sure their write flags are set correctly based on whether they are currently locked or unlocked. Files which are unlocked are made read-only, files which are locked are made writeable. Files whic

(files []string)

Source from the content-addressed store, hash-verified

137// state correctly reflects the locking state, and is more efficient than
138// FixAllLockableFileWriteFlags when you know which files changed
139func (c *Client) FixLockableFileWriteFlags(files []string) error {
140 // early-out if no lockable patterns
141 if len(c.GetLockablePatterns()) == 0 {
142 return nil
143 }
144
145 var multiErr error
146 for _, f := range files {
147 err := c.fixSingleFileWriteFlags(f, c.getLockableFilter(), nil)
148 if err != nil {
149 multiErr = errors.Join(multiErr, err)
150 }
151 }
152
153 return multiErr
154}
155
156// fixSingleFileWriteFlags fixes write flags on a single file
157// If lockablePatterns is non-nil, then any file matching those patterns will be

Callers 2

postCheckoutRevChangeFunction · 0.80
postCommitCommandFunction · 0.80

Calls 4

GetLockablePatternsMethod · 0.95
getLockableFilterMethod · 0.95
JoinFunction · 0.92

Tested by

no test coverage detected