MCPcopy Create free account
hub / github.com/go-git/go-git / incomingObjectPath

Method incomingObjectPath

storage/filesystem/dotgit/dotgit.go:576–584  ·  view source on GitHub ↗

incomingObjectPath is intended to add support for a git pre-receive hook to be written it adds support for go-git to find objects in an "incoming" directory, so that the library can be used to write a pre-receive hook that deals with the incoming objects. More on git hooks found here : https://git-

(h plumbing.Hash)

Source from the content-addressed store, hash-verified

574//
575// https://git-scm.com/docs/git-receive-pack
576func (d *DotGit) incomingObjectPath(h plumbing.Hash) string {
577 hString := h.String()
578
579 if d.incomingDirName == "" {
580 return d.fs.Join(objectsPath, hString[0:2], hString[2:hash.HexSize])
581 }
582
583 return d.fs.Join(objectsPath, d.incomingDirName, hString[0:2], hString[2:hash.HexSize])
584}
585
586// hasIncomingObjects searches for an incoming directory and keeps its name
587// so it doesn't have to be found each time an object is accessed.

Callers 3

ObjectMethod · 0.95
ObjectStatMethod · 0.95
ObjectDeleteMethod · 0.95

Calls 2

JoinMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected