MCPcopy Create free account
hub / github.com/git/git / add_pending_object_with_path

Function add_pending_object_with_path

revision.c:295–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295static void add_pending_object_with_path(struct rev_info *revs,
296 struct object *obj,
297 const char *name, unsigned mode,
298 const char *path)
299{
300 struct interpret_branch_name_options options = { 0 };
301 if (!obj)
302 return;
303 if (revs->no_walk && (obj->flags & UNINTERESTING))
304 revs->no_walk = 0;
305 if (revs->reflog_info && obj->type == OBJ_COMMIT) {
306 struct strbuf buf = STRBUF_INIT;
307 size_t namelen = strlen(name);
308 int len = repo_interpret_branch_name(the_repository, name,
309 namelen, &buf, &options);
310
311 if (0 < len && len < namelen && buf.len)
312 strbuf_addstr(&buf, name + len);
313 add_reflog_for_walk(revs->reflog_info,
314 (struct commit *)obj,
315 buf.buf[0] ? buf.buf: name);
316 strbuf_release(&buf);
317 return; /* do not add the commit itself */
318 }
319 add_object_array_with_path(obj, name, &revs->pending, mode, path);
320}
321
322static void add_pending_object_with_mode(struct rev_info *revs,
323 struct object *obj,

Callers 7

handle_commitFunction · 0.85
add_cache_treeFunction · 0.85
handle_dotdot_1Function · 0.85
handle_revision_arg_1Function · 0.85

Calls 5

strbuf_addstrFunction · 0.85
add_reflog_for_walkFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected