MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / listServerRefs

Function listServerRefs

src/api/listServerRefs.js:105–157  ·  view source on GitHub ↗
({
  http,
  onAuth,
  onAuthSuccess,
  onAuthFailure,
  corsProxy,
  url,
  headers = {},
  forPush = false,
  protocolVersion = 2,
  prefix,
  symrefs,
  peelTags,
})

Source from the content-addressed store, hash-verified

103 *
104 */
105export async function listServerRefs({
106 http,
107 onAuth,
108 onAuthSuccess,
109 onAuthFailure,
110 corsProxy,
111 url,
112 headers = {},
113 forPush = false,
114 protocolVersion = 2,
115 prefix,
116 symrefs,
117 peelTags,
118}) {
119 try {
120 assertParameter('http', http)
121 assertParameter('url', url)
122
123 const remote = await GitRemoteHTTP.discover({
124 http,
125 onAuth,
126 onAuthSuccess,
127 onAuthFailure,
128 corsProxy,
129 service: forPush ? 'git-receive-pack' : 'git-upload-pack',
130 url,
131 headers,
132 protocolVersion,
133 })
134
135 if (remote.protocolVersion === 1) {
136 return formatInfoRefs(remote, prefix, symrefs, peelTags)
137 }
138
139 // Protocol Version 2
140 const body = await writeListRefsRequest({ prefix, symrefs, peelTags })
141
142 const res = await GitRemoteHTTP.connect({
143 http,
144 auth: remote.auth,
145 headers,
146 corsProxy,
147 service: forPush ? 'git-receive-pack' : 'git-upload-pack',
148 url,
149 body,
150 })
151
152 return parseListRefsResponse(res.body)
153 } catch (err) {
154 err.caller = 'git.listServerRefs'
155 throw err
156 }
157}

Calls 6

assertParameterFunction · 0.90
formatInfoRefsFunction · 0.90
writeListRefsRequestFunction · 0.90
parseListRefsResponseFunction · 0.90
discoverMethod · 0.80
connectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…