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

Function lookup_other_head

revision.c:1975–1992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1973}
1974
1975static const char *lookup_other_head(struct object_id *oid)
1976{
1977 int i;
1978 static const char *const other_head[] = {
1979 "MERGE_HEAD", "CHERRY_PICK_HEAD", "REVERT_HEAD", "REBASE_HEAD"
1980 };
1981
1982 for (i = 0; i < ARRAY_SIZE(other_head); i++)
1983 if (!refs_read_ref_full(get_main_ref_store(the_repository), other_head[i],
1984 RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
1985 oid, NULL)) {
1986 if (is_null_oid(oid))
1987 die(_("%s exists but is a symbolic ref"), other_head[i]);
1988 return other_head[i];
1989 }
1990
1991 die(_("--merge requires one of the pseudorefs MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD"));
1992}
1993
1994static void prepare_show_merge(struct rev_info *revs)
1995{

Callers 1

prepare_show_mergeFunction · 0.85

Calls 4

refs_read_ref_fullFunction · 0.85
get_main_ref_storeFunction · 0.85
is_null_oidFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected