summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wt-status.c b/wt-status.c
index c327fe8128..3e3b8c0989 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1319,6 +1319,12 @@ static int grab_1st_switch(unsigned char *osha1, unsigned char *nsha1,
hashcpy(cb->nsha1, nsha1);
for (end = target; *end && *end != '\n'; end++)
;
+ if (!memcmp(target, "HEAD", end - target)) {
+ /* HEAD is relative. Resolve it to the right reflog entry. */
+ strbuf_addstr(&cb->buf,
+ find_unique_abbrev(nsha1, DEFAULT_ABBREV));
+ return 1;
+ }
strbuf_add(&cb->buf, target, end - target);
return 1;
}