diff --git a/src/view.c b/src/view.c index f4f3dea99..fa1a4041e 100644 --- a/src/view.c +++ b/src/view.c @@ -333,7 +333,8 @@ goto_id(struct view *view, const char *expr, bool from_start, bool save_search) report("Jumping to ID is not supported by the %s view", view->name); return; } else { - char *rev = argv_format_arg(view->env, expr); + char dest[SIZEOF_STR]; + char *rev = snprintf(dest, SIZEOF_STR, "%s^{}", expr) ? argv_format_arg(view->env, dest) : NULL; const char *rev_parse_argv[] = { "git", "rev-parse", "--revs-only", rev, NULL };