MCPcopy Index your code
hub / github.com/git/git / get_dav_token_headers

Function get_dav_token_headers

http-push.c:222–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222static struct curl_slist *get_dav_token_headers(struct remote_lock *lock, enum dav_header_flag options)
223{
224 struct strbuf buf = STRBUF_INIT;
225 struct curl_slist *dav_headers = http_copy_default_headers();
226
227 if (options & DAV_HEADER_IF) {
228 strbuf_addf(&buf, "If: (<%s>)", lock->token);
229 dav_headers = curl_slist_append(dav_headers, buf.buf);
230 strbuf_reset(&buf);
231 }
232 if (options & DAV_HEADER_LOCK) {
233 strbuf_addf(&buf, "Lock-Token: <%s>", lock->token);
234 dav_headers = curl_slist_append(dav_headers, buf.buf);
235 strbuf_reset(&buf);
236 }
237 if (options & DAV_HEADER_TIMEOUT) {
238 strbuf_addf(&buf, "Timeout: Second-%ld", lock->timeout);
239 dav_headers = curl_slist_append(dav_headers, buf.buf);
240 strbuf_reset(&buf);
241 }
242 strbuf_release(&buf);
243
244 return dav_headers;
245}
246
247static void finish_request(struct transfer_request *request);
248static void release_request(struct transfer_request *request);

Callers 4

refresh_lockFunction · 0.85
unlock_remoteFunction · 0.85
update_remoteFunction · 0.85
update_remote_info_refsFunction · 0.85

Calls 3

strbuf_addfFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected