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

Function strbuf_worktree_ref

worktree.c:583–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583void strbuf_worktree_ref(const struct worktree *wt,
584 struct strbuf *sb,
585 const char *refname)
586{
587 if (parse_worktree_ref(refname, NULL, NULL, NULL) ==
588 REF_WORKTREE_CURRENT &&
589 wt && !wt->is_current) {
590 if (is_main_worktree(wt))
591 strbuf_addstr(sb, "main-worktree/");
592 else
593 strbuf_addf(sb, "worktrees/%s/", wt->id);
594 }
595 strbuf_addstr(sb, refname);
596}
597
598int other_head_refs(refs_for_each_cb fn, void *cb_data)
599{

Callers 5

other_head_refsFunction · 0.85
handle_one_reflogFunction · 0.85
collect_reflogFunction · 0.85
fsck_handle_reflogFunction · 0.85
snapshot_refsFunction · 0.85

Calls 4

parse_worktree_refFunction · 0.85
is_main_worktreeFunction · 0.85
strbuf_addstrFunction · 0.85
strbuf_addfFunction · 0.85

Tested by

no test coverage detected