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

Method AddToIndex

t/cmd/util/testutils.go:282–291  ·  view source on GitHub ↗
(output *CommitOutput, repo *Repo)

Source from the content-addressed store, hash-verified

280}
281
282func (infile *FileInput) AddToIndex(output *CommitOutput, repo *Repo) {
283 inputData := infile.getFileInputReader()
284 pointer, err := infile.writeLFSPointer(repo, inputData)
285 if err != nil {
286 repo.callback.Errorf("%+v", err)
287 return
288 }
289 output.Files = append(output.Files, pointer)
290 RunGitCommand(repo.callback, true, "add", infile.Filename)
291}
292
293func (infile *FileInput) writeLFSPointer(repo *Repo, inputData io.Reader) (*lfs.Pointer, error) {
294 cleaned, err := repo.gitfilter.Clean(inputData, infile.Filename, infile.Size, nil)

Callers 1

AddCommitsMethod · 0.80

Calls 4

getFileInputReaderMethod · 0.95
writeLFSPointerMethod · 0.95
RunGitCommandFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected