| 1679 | }; |
| 1680 | |
| 1681 | static int grab_1st_switch(const char *refname UNUSED, |
| 1682 | struct object_id *ooid UNUSED, |
| 1683 | struct object_id *noid, |
| 1684 | const char *email UNUSED, |
| 1685 | timestamp_t timestamp UNUSED, int tz UNUSED, |
| 1686 | const char *message, void *cb_data) |
| 1687 | { |
| 1688 | struct grab_1st_switch_cbdata *cb = cb_data; |
| 1689 | const char *target = NULL, *end; |
| 1690 | |
| 1691 | if (!skip_prefix(message, "checkout: moving from ", &message)) |
| 1692 | return 0; |
| 1693 | target = strstr(message, " to "); |
| 1694 | if (!target) |
| 1695 | return 0; |
| 1696 | target += strlen(" to "); |
| 1697 | strbuf_reset(&cb->buf); |
| 1698 | oidcpy(&cb->noid, noid); |
| 1699 | end = strchrnul(target, '\n'); |
| 1700 | strbuf_add(&cb->buf, target, end - target); |
| 1701 | if (!strcmp(cb->buf.buf, "HEAD")) { |
| 1702 | /* HEAD is relative. Resolve it to the right reflog entry. */ |
| 1703 | strbuf_reset(&cb->buf); |
| 1704 | strbuf_add_unique_abbrev(&cb->buf, noid, DEFAULT_ABBREV); |
| 1705 | } |
| 1706 | return 1; |
| 1707 | } |
| 1708 | |
| 1709 | static void wt_status_get_detached_from(struct repository *r, |
| 1710 | struct wt_status_state *state) |
nothing calls this directly
no test coverage detected