MCPcopy
hub / github.com/go-git/go-git / incomingObjectPath

Method incomingObjectPath

storage/filesystem/dotgit/dotgit.go:583–591  ·  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

581//
582// https://git-scm.com/docs/git-receive-pack
583func (d *DotGit) incomingObjectPath(h plumbing.Hash) string {
584 hString := h.String()
585
586 if d.incomingDirName == "" {
587 return d.fs.Join(objectsPath, hString[0:2], hString[2:hash.HexSize])
588 }
589
590 return d.fs.Join(objectsPath, d.incomingDirName, hString[0:2], hString[2:hash.HexSize])
591}
592
593// hasIncomingObjects searches for an incoming directory and keeps its name
594// 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