Skip to content

Commit

Permalink
Fix :goto <tag>
Browse files Browse the repository at this point in the history
Dereference goto argument to make sure we try to reach the commit and
not the tag object for annotated tags.

Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
  • Loading branch information
koutcher committed Jan 25, 2022
1 parent 7218788 commit b4af9c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 tmp[SIZEOF_STR];
char *rev = (snprintf(tmp, SIZEOF_STR, "%s^{}", expr), argv_format_arg(view->env, tmp));
const char *rev_parse_argv[] = {
"git", "rev-parse", "--revs-only", rev, NULL
};
Expand Down

0 comments on commit b4af9c1

Please sign in to comment.