MCPcopy
hub / github.com/git-lfs/git-lfs / decodeRefs

Function decodeRefs

commands/command_pre_push.go:100–109  ·  view source on GitHub ↗

decodeRefs pulls the sha1s out of the line read from the pre-push hook's stdin.

(input string)

Source from the content-addressed store, hash-verified

98// decodeRefs pulls the sha1s out of the line read from the pre-push
99// hook's stdin.
100func decodeRefs(input string) (*git.Ref, *git.Ref) {
101 refs := strings.Split(strings.TrimSpace(input), " ")
102 for len(refs) < 4 {
103 refs = append(refs, "")
104 }
105
106 localRef := git.ParseRef(refs[0], refs[1])
107 remoteRef := git.ParseRef(refs[2], refs[3])
108 return localRef, remoteRef
109}
110
111func init() {
112 RegisterCommand("pre-push", prePushCommand, func(cmd *cobra.Command) {

Callers 1

prePushRefsFunction · 0.85

Calls 1

ParseRefFunction · 0.92

Tested by

no test coverage detected