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

Function check_not_current_branch

builtin/fetch.c:1495–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493}
1494
1495static void check_not_current_branch(struct ref *ref_map)
1496{
1497 const char *path;
1498 for (; ref_map; ref_map = ref_map->next)
1499 if (ref_map->peer_ref &&
1500 starts_with(ref_map->peer_ref->name, "refs/heads/") &&
1501 (path = branch_checked_out(ref_map->peer_ref->name)))
1502 die(_("refusing to fetch into branch '%s' "
1503 "checked out at '%s'"),
1504 ref_map->peer_ref->name, path);
1505}
1506
1507static int truncate_fetch_head(void)
1508{

Callers 1

do_fetchFunction · 0.85

Calls 3

starts_withFunction · 0.85
branch_checked_outFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected