MCPcopy Index your code
hub / github.com/sourcegraph/checkup / writeIndex

Method writeIndex

storage/github/github.go:230–237  ·  view source on GitHub ↗

writeIndex marshals the index into JSON and writes the file to the Git repo. It returns any errors associated with marshaling the data or writing the file.

(index map[string]int64, sha string)

Source from the content-addressed store, hash-verified

228// writeIndex marshals the index into JSON and writes the file to the Git repo.
229// It returns any errors associated with marshaling the data or writing the file.
230func (gh *Storage) writeIndex(index map[string]int64, sha string) error {
231 contents, err := json.Marshal(index)
232 if err != nil {
233 return err
234 }
235
236 return gh.writeFile(fs.IndexName, sha, contents)
237}
238
239// Store stores results in the Git repo & updates the index.
240func (gh *Storage) Store(results []types.Result) error {

Callers 2

StoreMethod · 0.95
MaintainMethod · 0.95

Implementers 5

fakecheckup_test.go
Storagestorage/sql/sql.go
Storagestorage/s3/s3.go
Storagestorage/github/github.go
Storagestorage/fs/fs.go

Calls 1

writeFileMethod · 0.95

Tested by

no test coverage detected