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

Function diagnose_missing_default

revision.c:2985–2998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2983}
2984
2985static void NORETURN diagnose_missing_default(const char *def)
2986{
2987 int flags;
2988 const char *refname;
2989
2990 refname = refs_resolve_ref_unsafe(get_main_ref_store(the_repository),
2991 def, 0, NULL, &flags);
2992 if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))
2993 die(_("your current branch appears to be broken"));
2994
2995 skip_prefix(refname, "refs/heads/", &refname);
2996 die(_("your current branch '%s' does not have any commits yet"),
2997 refname);
2998}
2999
3000/*
3001 * Parse revision information, filling in the "rev_info" structure,

Callers 1

setup_revisionsFunction · 0.85

Calls 3

refs_resolve_ref_unsafeFunction · 0.85
get_main_ref_storeFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected