| 1973 | } |
| 1974 | |
| 1975 | static 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 | |
| 1994 | static void prepare_show_merge(struct rev_info *revs) |
| 1995 | { |
no test coverage detected