MCPcopy Create free account
hub / github.com/google/git-appraise / getRemoteNotesRef

Function getRemoteNotesRef

repository/git.go:1027–1039  ·  view source on GitHub ↗
(remote, localNotesRef string)

Source from the content-addressed store, hash-verified

1025}
1026
1027func getRemoteNotesRef(remote, localNotesRef string) string {
1028 // Note: The pattern for remote notes deviates from that of remote heads and devtools,
1029 // because the git command line tool requires all notes refs to be located under the
1030 // "refs/notes/" prefix.
1031 //
1032 // Because of that, we make the remote refs a subset of the local refs instead of
1033 // a parallel tree, which is the pattern used for heads and devtools.
1034 //
1035 // E.G. ("refs/notes/..." -> "refs/notes/remotes/<remote>/...")
1036 // versus ("refs/heads/..." -> "refs/remotes/<remote>/...")
1037 relativeNotesRef := strings.TrimPrefix(localNotesRef, notesRefPrefix)
1038 return notesRefPrefix + "remotes/" + remote + "/" + relativeNotesRef
1039}
1040
1041func getLocalNotesRef(remote, remoteNotesRef string) string {
1042 relativeNotesRef := strings.TrimPrefix(remoteNotesRef, notesRefPrefix+"remotes/"+remote+"/")

Callers 3

MergeNotesMethod · 0.85
PullNotesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected